From ddec0783a813fee25e7dcc9921051b1d29921f5b Mon Sep 17 00:00:00 2001 From: locus313 Date: Sat, 14 Nov 2020 18:49:37 -0800 Subject: [PATCH] add brackets --- src/AnticheatMgr.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 1a25def..6c2d08a 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -88,23 +88,33 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo) { if (!sConfigMgr->GetBoolDefault("Anticheat.DetectFlyHack", true)) + { return; + } if (player->HasAuraType(SPELL_AURA_FLY) || player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || player->HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED))//overkill but wth + { return; + } /*Thanks to @LilleCarl for info to check extra flag*/ bool stricterChecks = true; if (sConfigMgr->GetBoolDefault("Anticheat.StricterFlyHackCheck", false)) + { stricterChecks = !(movementInfo.HasMovementFlag(MOVEMENTFLAG_ASCENDING) && !player->IsInWater()); + } if (!movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING) && stricterChecks) + { return; + } if (sConfigMgr->GetBoolDefault("Anticheat.KickPlayerFlyHack", false)) { if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false)) + { sLog->outString("AnticheatMgr:: Fly-Hack detected and counteracted by kicking player %s (%u)", player->GetName().c_str(), player->GetGUIDLow()); + } player->GetSession()->KickPlayer(true); if(sConfigMgr->GetBoolDefault("Anticheat.AnnounceKick", true)) @@ -118,7 +128,8 @@ void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo) " has been kicked.|r"; sWorld->SendServerMessage(SERVER_MSG_STRING, stream.str().c_str()); } - } else if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false)) { + } else if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false)) + { sLog->outString( "AnticheatMgr:: Fly-Hack detected player %s (%u)", player->GetName().c_str(), player->GetGUIDLow()); }