From a354b09f1d502d30fb07467fc52d39230215c947 Mon Sep 17 00:00:00 2001 From: MDIC Date: Tue, 3 May 2022 14:34:41 -0400 Subject: [PATCH] fix (module): Wall Climb False hit reduction --- src/AnticheatMgr.cpp | 12 ++++++++++-- src/AnticheatMgr.h | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 008a0bc..034b638 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -410,7 +410,7 @@ void AnticheatMgr::StartHackDetection(Player* player, MovementInfo movementInfo, FlyHackDetection(player, movementInfo); JumpHackDetection(player, movementInfo, opcode); TeleportPlaneHackDetection(player, movementInfo); - ClimbHackDetection(player, movementInfo); + ClimbHackDetection(player, movementInfo, opcode); TeleportHackDetection(player, movementInfo); IgnoreControlHackDetection(player, movementInfo); if (player->GetLiquidData().Status == LIQUID_MAP_WATER_WALK) @@ -426,7 +426,7 @@ void AnticheatMgr::StartHackDetection(Player* player, MovementInfo movementInfo, } // basic detection -void AnticheatMgr::ClimbHackDetection(Player* player, MovementInfo movementInfo) +void AnticheatMgr::ClimbHackDetection(Player* player, MovementInfo movementInfo, uint32 opcode) { if (!sConfigMgr->GetOption("Anticheat.DetectClimbHack", true)) return; @@ -437,6 +437,14 @@ void AnticheatMgr::ClimbHackDetection(Player* player, MovementInfo movementInfo) player->IsFalling()) return; + // If the player jumped, we dont want to check for climb hack + // This can lead to false positives for climbing game objects legit + if (opcode == MSG_MOVE_JUMP) + return; + + if (player->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + return; + Position playerPos = player->GetPosition(); float diffz = fabs(movementInfo.pos.GetPositionZ() - playerPos.GetPositionZ()); diff --git a/src/AnticheatMgr.h b/src/AnticheatMgr.h index 1b04aca..ea84dca 100644 --- a/src/AnticheatMgr.h +++ b/src/AnticheatMgr.h @@ -75,7 +75,7 @@ class AnticheatMgr void WalkOnWaterHackDetection(Player* player, MovementInfo movementInfo); void JumpHackDetection(Player* player, MovementInfo movementInfo,uint32 opcode); void TeleportPlaneHackDetection(Player* player, MovementInfo); - void ClimbHackDetection(Player* player,MovementInfo movementInfo); + void ClimbHackDetection(Player* player,MovementInfo movementInfo, uint32 opcode); void TeleportHackDetection(Player* player, MovementInfo movementInfo); void IgnoreControlHackDetection(Player* player, MovementInfo movementInfo); void ZAxisHackDetection(Player* player, MovementInfo movementInfo);