fix (module): Readd teleport helper for speed hack

This commit is contained in:
MDIC
2022-04-21 14:00:14 -04:00
parent b9923c96c9
commit 728dbfa440

View File

@@ -504,6 +504,8 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
if (player->duel)
{
if ((clientSpeedRate > speedRate) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING))
{
if (!player->CanTeleport())
{
Player* opponent = player->duel->Opponent;
std::string str = "|cFFFFFC00[DUEL CHEAT ALERT Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Speed Hack Detected! While Dueling [|cFF60FF00" + std::string(opponent->GetName().c_str()) + "|cFF00FFFF]";
@@ -519,20 +521,22 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
}
BuildReport(player, SPEED_HACK_REPORT);
BuildReport(opponent, SPEED_HACK_REPORT);
}
return;
}
}
// We did the (uint32) cast to accept a margin of tolerance
// We check the last MovementInfo for the falling flag since falling down a hill and sliding a bit triggered a false positive
if ((clientSpeedRate > speedRate) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING))
{
if (!player->CanTeleport())
{
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
LOG_INFO("module", "AnticheatMgr:: Speed-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
}
BuildReport(player, SPEED_HACK_REPORT);
}
return;
}
}