Core/Entities: fix creatures ignoring immune flags.

This commit is contained in:
ariel- authored and Ovahlord committed 2022-09-12 09:15:16 +02:00
1 parent b3c8d78fa2
commit 1725fa9006
1 file changed
+1 -1
+1 -1
View File
@@ -3011,7 +3011,7 @@ bool WorldObject::IsValidAttackTarget(WorldObject const* target, SpellInfo const
return false;
// ignore immunity flags when assisting
if (isPositiveSpell && !bySpell->HasAttribute(SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG))
if (!bySpell || (isPositiveSpell && !bySpell->HasAttribute(SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG)))
{
if (unit && !unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && unitTarget && unitTarget->IsImmuneToNPC())
return false;