From 039ed9b782abf67f959aa80c1f6e3d0489059b78 Mon Sep 17 00:00:00 2001 From: MDIC Date: Thu, 11 Aug 2022 08:53:18 -0400 Subject: [PATCH] update (detection): Reformulated Ignore Control --- src/AnticheatMgr.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index a144d33..387a20b 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -441,10 +441,14 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn void AnticheatMgr::IgnoreControlHackDetection(Player* player, MovementInfo movementInfo, uint32 opcode) { - float x, y; - player->GetPosition(x, y); ObjectGuid key = player->GetGUID(); + float lastX = m_Players[key].GetLastMovementInfo().pos.GetPositionX(); + float newX = movementInfo.pos.GetPositionX(); + + float lastY = m_Players[key].GetLastMovementInfo().pos.GetPositionY(); + float newY = movementInfo.pos.GetPositionY(); + if (!sConfigMgr->GetOption("Anticheat.IgnoreControlHack", true)) return; @@ -461,7 +465,7 @@ void AnticheatMgr::IgnoreControlHackDetection(Player* player, MovementInfo movem latency = player->GetSession()->GetLatency() >= 400; if (player->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED) && !player->GetVehicle() && !latency) { - bool unrestricted = movementInfo.pos.GetPositionX() != x || movementInfo.pos.GetPositionY() != y; + bool unrestricted = newX != lastX || newY != lastY; if (unrestricted) { if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption("Anticheat.ReportsForIngameWarnings", 70))