diff options
author | thenecromancer <none@none> | 2010-01-13 10:20:00 +0100 |
---|---|---|
committer | thenecromancer <none@none> | 2010-01-13 10:20:00 +0100 |
commit | 8dd67e8bb31ef3740fcff936eb65223072a52729 (patch) | |
tree | fc4b3c57850014f9eeaf10f67c63f71167fcecaa /src/game/Unit.cpp | |
parent | 6b07806d0c034e6b88cf0426c753e620841181a5 (diff) |
Allow state/effect immunities ignore whole spell when one effect is immuned
(Fixes getting part of CC auras with some immunities)
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index f0c16365606..fdd2816d8c9 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10653,6 +10653,14 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo) if (itr->type == spellInfo->Mechanic) return true; } +
+ 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;
+ } if (spellInfo->Id != 42292 && spellInfo->Id !=59752) { @@ -10667,7 +10675,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo) return false; } -bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const +bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index, bool checkMechanic) const { if (!spellInfo) return false; @@ -10678,12 +10686,15 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) con if (itr->type == effect) return true; - if (uint32 mechanic = spellInfo->EffectMechanic[index]) + if (checkMechanic) { - 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 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; + } } if (uint32 aura = spellInfo->EffectApplyAuraName[index]) |