diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index eb4d339..6da9eb6 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -505,21 +505,23 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo) { if ((clientSpeedRate > speedRate) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING)) { - 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]"; - WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); - data << str; - sWorld->SendGlobalGMMessage(&data); - - sWorld->SendGMText(LANG_ANTICHEAT_DUEL, player->GetName().c_str(), opponent->GetName().c_str()); - if (sConfigMgr->GetOption("Anticheat.WriteLog", true)) + if (!player->CanTeleport()) { - LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Speed-Hack detected player {} ({}) while dueling {}", player->GetName(), player->GetGUID().ToString(), opponent->GetName()); - LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Speed-Hack detected player {} ({}) while dueling {}", opponent->GetName(), opponent->GetGUID().ToString(), player->GetName()); - } - BuildReport(player, SPEED_HACK_REPORT); - BuildReport(opponent, SPEED_HACK_REPORT); + 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]"; + WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); + data << str; + sWorld->SendGlobalGMMessage(&data); + sWorld->SendGMText(LANG_ANTICHEAT_DUEL, player->GetName().c_str(), opponent->GetName().c_str()); + if (sConfigMgr->GetOption("Anticheat.WriteLog", true)) + { + LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Speed-Hack detected player {} ({}) while dueling {}", player->GetName(), player->GetGUID().ToString(), opponent->GetName()); + LOG_INFO("module", "AnticheatMgr:: DUEL ALERT Speed-Hack detected player {} ({}) while dueling {}", opponent->GetName(), opponent->GetGUID().ToString(), player->GetName()); + } + BuildReport(player, SPEED_HACK_REPORT); + BuildReport(opponent, SPEED_HACK_REPORT); + } return; } } @@ -527,12 +529,14 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo) // 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 (sConfigMgr->GetOption("Anticheat.WriteLog", true)) + if (!player->CanTeleport()) { - LOG_INFO("module", "AnticheatMgr:: Speed-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString()); + if (sConfigMgr->GetOption("Anticheat.WriteLog", true)) + { + LOG_INFO("module", "AnticheatMgr:: Speed-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString()); + } + BuildReport(player, SPEED_HACK_REPORT); } - BuildReport(player, SPEED_HACK_REPORT); - return; } }