diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2016-12-13 15:15:20 -0300 |
|---|---|---|
| committer | DoctorKraft <DoctorKraft@users.noreply.github.com> | 2018-03-12 16:39:40 +0100 |
| commit | 536ae257c903decaa9e3528a03f1c87f08efa38e (patch) | |
| tree | b5177417359e24bf1f436cbe8f722b216bc10053 /src/server/game/Entities/Unit | |
| parent | 0449d3a83657436a3379c62d11259f3c83b4a431 (diff) | |
Core/Spell: partial revert of SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE immunity handling
- Bonus: without breaking Banish... yay!
Closes #18370
(cherry picked from commit 560c882b364630bf95e1c6859ceaa6fa3cb6ed2e)
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 381ab4f2f45..9d209ba9550 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7167,7 +7167,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const { // State/effect immunities applied by aura expect full spell immunity // Ignore effects with mechanic, they are supposed to be checked separately - if (!effect) + if (!effect || !effect->IsEffect()) continue; if (!IsImmunedToSpellEffect(spellInfo, effect->EffectIndex, caster)) { @@ -7179,17 +7179,14 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Unit* caster) const if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects. return true; - if (!spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) + SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; + for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) { - SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; - for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr) - { - SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); - if ((itr->first & spellInfo->GetSchoolMask()) - && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && IsFriendlyTo(caster)) - && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) - return true; - } + SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second); + if ((itr->first & spellInfo->GetSchoolMask()) + && !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive() && IsFriendlyTo(caster)) + && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) + return true; } return false; |
