Core/Auras: Fixed requireImmunityPurgesEffectAttribute logic for school immunities

Port From (https://github.com/TrinityCore/TrinityCore/commit/ffbde7cccc6b0d697f915345c48e2b70dc110f38)
This commit is contained in:
hondacrx
2022-10-01 16:39:06 -04:00
parent 16a7b3bb79
commit e9ad8c63f8
+5 -2
View File
@@ -1295,10 +1295,13 @@ namespace Game.Entities
continue;
SpellInfo immuneSpellInfo = Global.SpellMgr.GetSpellInfo(pair.Value, GetMap().GetDifficultyID());
if (requireImmunityPurgesEffectAttribute)
if (immuneSpellInfo == null || !immuneSpellInfo.HasAttribute(SpellAttr1.ImmunityPurgesEffect))
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 != null && !immuneSpellInfo.IsPositive() && (!requireImmunityPurgesEffectAttribute || immuneSpellInfo.HasAttribute(SpellAttr1.ImmunityPurgesEffect)))
|| !spellInfo.IsPositive() || caster == null || !IsFriendlyTo(caster))
if ((immuneSpellInfo != null && !immuneSpellInfo.IsPositive()) || !spellInfo.IsPositive() || caster == null || !IsFriendlyTo(caster))
if (!spellInfo.CanPierceImmuneAura(immuneSpellInfo))
schoolImmunityMask |= pair.Key;
}