diff --git a/src/AnticheatData.h b/src/AnticheatData.h index 700ad2d..2d79d1d 100644 --- a/src/AnticheatData.h +++ b/src/AnticheatData.h @@ -60,4 +60,4 @@ private: bool hasDailyReport; }; -#endif \ No newline at end of file +#endif diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index be96b1f..47ef305 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -48,24 +48,31 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme if (!sConfigMgr->GetOption("Anticheat.DetectWaterWalkHack", true)) return; - ObjectGuid key = player->GetGUID(); - /* Thanks to @LilleCarl */ - if (!m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_WATERWALKING)) - return; - - // if we are a ghost we can walk on water - if (!player->IsAlive()) + // ghost can water walk + if (player->HasAuraType(SPELL_AURA_GHOST)) return; // Prevents the False Positive for water walking when you ressurrect. - // Aura 15007 (Resurrectino sickness) is given while dead before returning back to life. - if (!player->IsAlive() && player->HasAura(15007)) + // Aura 15007 (Resurrection sickness) is given while dead before returning back to life. + if (player->HasAuraType(SPELL_AURA_GHOST) && player->HasAura(15007)) return; - if (player->HasAuraType(SPELL_AURA_FEATHER_FALL) || - player->HasAuraType(SPELL_AURA_SAFE_FALL) || - player->HasAuraType(SPELL_AURA_WATER_WALK)) + ObjectGuid key = player->GetGUID(); + /* Thanks to @LilleCarl */ + if (m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && movementInfo.HasMovementFlag(MOVEMENTFLAG_WATERWALKING)) + { + if (player->HasAuraType(SPELL_AURA_WATER_WALK) || player->HasAuraType(SPELL_AURA_FEATHER_FALL) || + player->HasAuraType(SPELL_AURA_SAFE_FALL)) + { + return; + } + + } + else if (!m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_WATERWALKING)) + { return; + } + if (sConfigMgr->GetOption("Anticheat.KickPlayerWaterWalkHack", false)) { if (sConfigMgr->GetOption("Anticheat.WriteLog", false)) @@ -84,11 +91,11 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme sWorld->SendServerMessage(SERVER_MSG_STRING, stream.str().c_str()); } } - else if (sConfigMgr->GetOption("Anticheat.WriteLog", false)) { + else if (sConfigMgr->GetOption("Anticheat.WriteLog", false)) + { LOG_INFO("module", "AnticheatMgr:: Walk on Water - Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString()); } BuildReport(player, WALK_WATER_HACK_REPORT); - } void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo) diff --git a/src/AnticheatMgr.h b/src/AnticheatMgr.h index b8dbdbe..4e13c49 100644 --- a/src/AnticheatMgr.h +++ b/src/AnticheatMgr.h @@ -66,9 +66,6 @@ class AnticheatMgr } void StartHackDetection(Player* player, MovementInfo movementInfo, uint32 opcode); - void DeletePlayerReport(Player* player, bool login); - void DeletePlayerData(Player* player); - void CreatePlayerData(Player* player); void SavePlayerData(Player* player); void HandlePlayerLogin(Player* player);