From b527bd99d6b66f3aadf65378bda6ae36b7427b3a Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 5 Jan 2022 23:21:32 -0500 Subject: [PATCH] Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too Port From (https://github.com/TrinityCore/TrinityCore/commit/96ec8477f0b9580881a955356a42fb3b109c0b49 --- Source/Game/Entities/Unit/Unit.Spells.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index 154c01065..0225806f0 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -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; }