Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too

Port From (https://github.com/TrinityCore/TrinityCore/commit/96ec8477f0b9580881a955356a42fb3b109c0b49
This commit is contained in:
hondacrx
2022-01-05 23:21:32 -05:00
parent 63e8ecd4ec
commit b527bd99d6
+3 -1
View File
@@ -1278,7 +1278,9 @@ namespace Game.Entities
continue;
SpellInfo immuneSpellInfo = Global.SpellMgr.GetSpellInfo(pair.Value, GetMap().GetDifficultyID());
if (!(immuneSpellInfo != null && 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 != null && !immuneSpellInfo.IsPositive()) || !spellInfo.IsPositive() || caster == null || !IsFriendlyTo(caster))
if (!spellInfo.CanPierceImmuneAura(immuneSpellInfo))
schoolImmunityMask |= pair.Key;
}