diff options
author | QAston <none@none> | 2009-02-06 23:01:07 +0100 |
---|---|---|
committer | QAston <none@none> | 2009-02-06 23:01:07 +0100 |
commit | a38297f28f8a8341967fa8fe5b0919b6d6aa04fc (patch) | |
tree | fe4a7bbce25ede3bc40dcbd937e1c975989d5906 /src/game/Unit.cpp | |
parent | 5bdb0560ba6caa93829b838c93b6d4042c71b75d (diff) |
*Handle aura SPELL_AURA_MECHANIC_IMMUNITY_MASK.
*Fix a typo in ap bonus from stat calculation-thanks to megamage for pointing this.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 9d50436d6be..98f66f09711 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8783,7 +8783,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo) SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; for(SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) { - if(itr->type == spellInfo->Mechanic) + if(itr->type & (1<<spellInfo->Mechanic)) { return true; } @@ -8803,6 +8803,8 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo) bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const { + if (!spellInfo) + return false; //If m_immuneToEffect type contain this effect type, IMMUNE effect. uint32 effect = spellInfo->Effect[index]; SpellImmuneList const& effectList = m_spellImmune[IMMUNITY_EFFECT]; @@ -8814,7 +8816,7 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) con { SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) - if(itr->type == mechanic) + if(itr->type & 1<<(spellInfo->EffectMechanic[index])) return true; } |