From 18a4cbee5eb10cf0502ffae9c89ad468a2c58012 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Thu, 26 Dec 2019 13:58:45 +0100 Subject: Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too (#23999) --- src/server/game/Entities/Unit/Unit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4103bef317c..e0d4e43b966 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7628,7 +7628,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; } -- cgit v1.2.3