From a38297f28f8a8341967fa8fe5b0919b6d6aa04fc Mon Sep 17 00:00:00 2001 From: QAston Date: Fri, 6 Feb 2009 23:01:07 +0100 Subject: *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 --- src/game/Unit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/game/Unit.cpp') 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<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; } -- cgit v1.2.3