Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too (#23999)

This commit is contained in:
Giacomo Pozzoni authored and Ovahlord committed 2022-09-12 09:15:26 +02:00
1 parent d2918d2138
commit b052d23c4f
1 file changed
+3 -1
+3 -1
View File
@@ -7373,7 +7373,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, WorldObject const* caste
continue;
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second);
if (!(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && caster && IsFriendlyTo(caster)))
// Consider the school immune if any of these conditions are not satisfied.
// In case of no immuneSpellInfo, ignore that condition and check only the other conditions
if ((immuneSpellInfo && !immuneSpellInfo->IsPositive()) || !spellInfo->IsPositive() || !caster || !IsFriendlyTo(caster))
if (!spellInfo->CanPierceImmuneAura(immuneSpellInfo))
schoolImmunityMask |= itr->first;
}