From 1811b3b46f4ee5f736542656db3800240e5fa0c9 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Tue, 9 Aug 2022 03:21:37 -0600 Subject: [PATCH] Added InfiniteStamina:Packet for Waverider(Boat) --- .../src/user/cheat/player/InfiniteStamina.cpp | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/cheat-library/src/user/cheat/player/InfiniteStamina.cpp b/cheat-library/src/user/cheat/player/InfiniteStamina.cpp index dd256b2..ce26e8d 100644 --- a/cheat-library/src/user/cheat/player/InfiniteStamina.cpp +++ b/cheat-library/src/user/cheat/player/InfiniteStamina.cpp @@ -79,36 +79,41 @@ namespace cheat::feature static bool afterDash = false; auto& manager = game::EntityManager::instance(); - if (manager.avatar()->runtimeID() != entityId) - return; - - // LOG_DEBUG("Movement packet: %s", magic_enum::enum_name(syncInfo->fields.motionState).data()); - if (f_Enabled && f_PacketReplacement) + auto entity = manager.entity(entityId); + if (entity->type() == app::EntityType__Enum_1::Vehicle || entity->isAvatar()) { - auto state = syncInfo->fields.motionState; - switch (state) + // LOG_DEBUG("Movement packet: %s", magic_enum::enum_name(syncInfo->fields.motionState).data()); + if (f_Enabled && f_PacketReplacement) { - case app::MotionState__Enum::MotionDash: - case app::MotionState__Enum::MotionClimb: - case app::MotionState__Enum::MotionClimbJump: - case app::MotionState__Enum::MotionStandbyToClimb: - case app::MotionState__Enum::MotionSwimDash: - case app::MotionState__Enum::MotionSwimIdle: - case app::MotionState__Enum::MotionSwimMove: - case app::MotionState__Enum::MotionSwimJump: - case app::MotionState__Enum::MotionFly: - case app::MotionState__Enum::MotionFight: - case app::MotionState__Enum::MotionDashBeforeShake: - case app::MotionState__Enum::MotionDangerDash: - syncInfo->fields.motionState = app::MotionState__Enum::MotionRun; - break; - case app::MotionState__Enum::MotionJump: - if (afterDash) + auto state = syncInfo->fields.motionState; + switch (state) + { + case app::MotionState__Enum::MotionDash: + case app::MotionState__Enum::MotionClimb: + case app::MotionState__Enum::MotionClimbJump: + case app::MotionState__Enum::MotionStandbyToClimb: + case app::MotionState__Enum::MotionSwimDash: + case app::MotionState__Enum::MotionSwimIdle: + case app::MotionState__Enum::MotionSwimMove: + case app::MotionState__Enum::MotionSwimJump: + case app::MotionState__Enum::MotionFly: + case app::MotionState__Enum::MotionFight: + case app::MotionState__Enum::MotionDashBeforeShake: + case app::MotionState__Enum::MotionDangerDash: syncInfo->fields.motionState = app::MotionState__Enum::MotionRun; - break; + break; + case app::MotionState__Enum::MotionJump: + if (afterDash) + syncInfo->fields.motionState = app::MotionState__Enum::MotionRun; + break; + case app::MotionState__Enum::MotionSkiffDash: + case app::MotionState__Enum::MotionSkiffPoweredDash: + syncInfo->fields.motionState = app::MotionState__Enum::MotionSkiffNormal; + break; + } + if (state != app::MotionState__Enum::MotionJump && state != app::MotionState__Enum::MotionFallOnGround) + afterDash = state == app::MotionState__Enum::MotionDash; } - if (state != app::MotionState__Enum::MotionJump && state != app::MotionState__Enum::MotionFallOnGround) - afterDash = state == app::MotionState__Enum::MotionDash; } }