diff options
author | Anubisss <none@none> | 2010-01-20 21:16:28 +0100 |
---|---|---|
committer | Anubisss <none@none> | 2010-01-20 21:16:28 +0100 |
commit | 81548313359384b50474bb6ad97d22f63ba71c20 (patch) | |
tree | d5e6608a939098d3fa0206f507c5c49601a20d37 /src/game/Unit.cpp | |
parent | 6855787a8376242120ef626f4fbbb80fc7b0baab (diff) | |
parent | fbe09a92f960e24b90711b55f0d2f3a864605d3d (diff) |
Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 070cabbe563..915410430f3 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10743,9 +10743,10 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo) for (int i=0;i<3;++i) { // State/effect immunities applied by aura expect full spell immunity - // However function also check for mechanic, so ignore that for now - if (IsImmunedToSpellEffect(spellInfo, i, false)) - return true; + // Ignore effects with mechanic, they are supposed to be checked separately + if (!spellInfo->EffectMechanic[i]) + if (IsImmunedToSpellEffect(spellInfo, i)) + return true; } if (spellInfo->Id != 42292 && spellInfo->Id !=59752) @@ -10761,7 +10762,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo) return false; } -bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bool checkMechanic) const +bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const { if (!spellInfo) return false; @@ -10772,15 +10773,12 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, boo if (itr->type == effect) return true; - if (checkMechanic) + if (uint32 mechanic = spellInfo->EffectMechanic[index]) { - if (uint32 mechanic = spellInfo->EffectMechanic[index]) - { - SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; - for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) - if (itr->type == spellInfo->EffectMechanic[index]) - return true; - } + SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; + for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) + if (itr->type == spellInfo->EffectMechanic[index]) + return true; } if (uint32 aura = spellInfo->EffectApplyAuraName[index]) |