From 9e998625ff083a58f4bae104cb3ccfce676cda07 Mon Sep 17 00:00:00 2001 From: MDIC Date: Sat, 16 Apr 2022 13:01:53 -0400 Subject: [PATCH] Update: Wall Climb Imrpovement Water Hack Reporting reduction We exempt rotating the camera from fire off with water walking hack detection, we improve angle reporting per @sveN295 formula. we also remove falling from the angle check as falling is check before hand Co-Authored-By: Sven <36102838+sven295@users.noreply.github.com> Co-Authored-By: Jinnaix <37972361+jinnaix@users.noreply.github.com> --- src/AnticheatMgr.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 05b9ec2..d304a91 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -63,6 +63,13 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme ObjectGuid key = player->GetGUID(); + uint32 distance2D = (uint32)movementInfo.pos.GetExactDist2d(&m_Players[key].GetLastMovementInfo().pos); + + // We don't need to check for a water walking hack if the player hasn't moved + // This is necessary since MovementHandler fires if you rotate the camera in place + if (!distance2D) + return; + if (player->GetLiquidData().Status == LIQUID_MAP_WATER_WALK) { if (!m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_WATERWALKING)) @@ -370,11 +377,11 @@ void AnticheatMgr::ClimbHackDetection(Player* player, MovementInfo movementInfo, Position playerPos = player->GetPosition(); float deltaZ = fabs(playerPos.GetPositionZ() - movementInfo.pos.GetPositionZ()); - float deltaXY = movementInfo.pos.GetExactDist2d(&playerPos); + float deltaXY = movementInfo.pos.GetExactDist2d(m_Players[key].GetLastMovementInfo().pos); float angle = Position::NormalizeOrientation(tan(deltaZ / deltaXY)); - if ((angle > CLIMB_ANGLE) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING)) + if (angle > CLIMB_ANGLE) { if (sConfigMgr->GetOption("Anticheat.WriteLog", true)) {