From 3875a3b09463e76f140b22566a146d77d03ade82 Mon Sep 17 00:00:00 2001 From: Elmsroth Date: Tue, 28 Jul 2020 22:27:04 +0100 Subject: [PATCH] Fix potential NullPointerException on C'Thun (#107) Reported from a crash on C'Thun it appeared there was a NPE in Creature.cpp --- src/game/Object/Creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/Object/Creature.cpp b/src/game/Object/Creature.cpp index 4e522991a..91c4794d1 100644 --- a/src/game/Object/Creature.cpp +++ b/src/game/Object/Creature.cpp @@ -2734,7 +2734,7 @@ bool Creature::MeetsSelectAttackingRequirement(Unit* pTarget, SpellEntry const* return false; } - if (selectFlags & SELECT_FLAG_IN_LOS && !IsWithinLOSInMap(pTarget)) + if (pSpellInfo && selectFlags & SELECT_FLAG_IN_LOS && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, pSpellInfo->Id, pTarget, SPELL_DISABLE_LOS) && !IsWithinLOSInMap(pTarget)) { return false; }