From 7c2f0e4f2b465b3a2f79d4da65ab790eb794c212 Mon Sep 17 00:00:00 2001 From: MDIC Date: Sat, 9 Apr 2022 18:34:18 -0400 Subject: [PATCH] Dont check for SpeedHack if the player hasnt moved We don't need to check for a speedhack if the player hasn't moved This is necessary since MovementHandler fires if you rotate the camera in place Co-Authored-By: Jinnaix <37972361+jinnaix@users.noreply.github.com> Co-Authored-By: Sven <36102838+sveN295@users.noreply.github.com> --- src/AnticheatMgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 527f387..6f5fac5 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -417,6 +417,11 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo) uint32 distance2D = (uint32)movementInfo.pos.GetExactDist2d(&m_Players[key].GetLastMovementInfo().pos); uint8 moveType = 0; + // We don't need to check for a speedhack if the player hasn't moved + // This is necessary since MovementHandler fires if you rotate the camera in place + if (!distance2D) + return; + // we need to know HOW is the player moving // TO-DO: Should we check the incoming movement flags? if (player->HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING))