From 7361818891007a3ba0aed9357c9aff24ae441a16 Mon Sep 17 00:00:00 2001 From: MDIC Date: Sat, 6 Aug 2022 14:47:03 -0400 Subject: [PATCH] update (detection): Teleport edge case fix --- src/AnticheatMgr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 8333876..651f7e1 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -366,12 +366,16 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn float lastY = m_Players[key].GetLastMovementInfo().pos.GetPositionY(); float newY = movementInfo.pos.GetPositionY(); + float lastZ = m_Players[key].GetLastMovementInfo().pos.GetPositionZ(); + float newZ = movementInfo.pos.GetPositionZ(); + float xDiff = fabs(lastX - newX); float yDiff = fabs(lastY - newY); + float zDiff = fabs(lastZ - newZ); if (player->duel) { - if ((xDiff >= 50.0f || yDiff >= 50.0f) && !player->CanTeleport()) + if ((xDiff >= 50.0f || yDiff >= 50.0f || zDiff >= 10.0f) && !player->CanTeleport()) { Player* opponent = player->duel->Opponent; @@ -397,7 +401,7 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn player->SetCanTeleport(false); } - if ((xDiff >= 50.0f || yDiff >= 50.0f) && !player->CanTeleport()) + if ((xDiff >= 50.0f || yDiff >= 50.0f || zDiff >= 10.0f) && !player->CanTeleport()) { if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption("Anticheat.ReportsForIngameWarnings", 70)) {