diff options
| author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-12-26 13:58:45 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-12-19 15:31:34 +0100 |
| commit | 96ec8477f0b9580881a955356a42fb3b109c0b49 (patch) | |
| tree | c04fb8da549b4e085036891751f80672d49d4e19 | |
| parent | fda1630f74af7ebdc056f6af8d9a2fac42fc9631 (diff) | |
Core/Creatures: Fix spell_school_immune_mask being applied against positive spells too (#23999)
(cherry picked from commit 18a4cbee5eb10cf0502ffae9c89ad468a2c58012)
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 4 |
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 d7d4fe80531..33ddfbd92e5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7127,7 +7127,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, WorldObject const* caste continue; SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second, GetMap()->GetDifficultyID()); - 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; } |
