aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2019-12-26 13:58:45 +0100
committerGitHub <noreply@github.com>2019-12-26 13:58:45 +0100
commit18a4cbee5eb10cf0502ffae9c89ad468a2c58012 (patch)
tree88daa9765e05c1c253a2b01d5fa776364c9acda6
parent7920347f439b1c17805182a4f22d3b3b9f521a29 (diff)
Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too (#23999)
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}