From 875b3f4bf7b3bfa7944f274b860fdb3fc2a6c691 Mon Sep 17 00:00:00 2001 From: M'Dic Date: Thu, 6 Oct 2022 08:53:27 -0400 Subject: [PATCH] Update (codestyle): Dereferencing NULL possible null pointer dereference player Not liking the idea of inflating, but it ensures now warnings or dereferencing occurs in testings. --- src/AnticheatMgr.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 6747a7c..043f709 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -351,7 +351,13 @@ void AnticheatMgr::TeleportPlaneHackDetection(Player* player, MovementInfo movem if (player && GetWMOAreaTableEntryByTripple(5202, 0, 24083)) return; - if (player->HasAuraType(SPELL_AURA_WATER_WALK) || player->HasAuraType(SPELL_AURA_WATER_BREATHING) || player->HasAuraType(SPELL_AURA_GHOST)) + if (player->HasAuraType(SPELL_AURA_WATER_WALK)) + return; + + if (player->HasAuraType(SPELL_AURA_WATER_BREATHING)) + return; + + if(player->HasAuraType(SPELL_AURA_GHOST)) return; ObjectGuid key = player->GetGUID(); @@ -695,7 +701,10 @@ void AnticheatMgr::ZAxisHackDetection(Player* player, MovementInfo movementInfo) return; // If he is flying we dont need to check - if (movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING)) + if (movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY)) + return; + + if (movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING)) return; // If the player is allowed to waterwalk (or he is dead because he automatically waterwalks then) we dont need to check any further