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>
This commit is contained in:
MDIC
2022-04-09 18:34:18 -04:00
parent f4bad98b93
commit 7c2f0e4f2b

View File

@@ -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))