Core/Auras: Fixed requireImmunityPurgesEffectAttribute logic for school immunities

This commit is contained in:
Shauren authored and Ovahlord committed 2022-09-30 12:50:31 +02:00
1 parent c3b52fd29f
commit b4a39d42a8
1 file changed
+4 -2
+4 -2
View File
@@ -7376,11 +7376,13 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, WorldObject const* caste
continue;
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second);
if (requireImmunityPurgesEffectAttribute)
if (!immuneSpellInfo || !immuneSpellInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
continue;
// 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() && (!requireImmunityPurgesEffectAttribute || immuneSpellInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT)))
|| !spellInfo->IsPositive() || !caster || !IsFriendlyTo(caster))
if ((immuneSpellInfo && !immuneSpellInfo->IsPositive()) || !spellInfo->IsPositive() || !caster || !IsFriendlyTo(caster))
if (!spellInfo->CanPierceImmuneAura(immuneSpellInfo))
schoolImmunityMask |= itr->first;
}