Merge pull request #6827 from drskull/master

Core/Spells: Small fix IsImmunedToSpell
This commit is contained in:
QAston
2012-06-17 15:20:38 -07:00
2 changed files with 6 additions and 0 deletions
@@ -1676,11 +1676,15 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
// the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data. // the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data.
bool immunedToAllEffects = true; bool immunedToAllEffects = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!spellInfo->Effects[i].IsEffect())
continue;
if (!IsImmunedToSpellEffect(spellInfo, i)) if (!IsImmunedToSpellEffect(spellInfo, i))
{ {
immunedToAllEffects = false; immunedToAllEffects = false;
break; break;
} }
}
if (immunedToAllEffects) if (immunedToAllEffects)
return true; return true;
+2
View File
@@ -11457,6 +11457,8 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
{ {
// State/effect immunities applied by aura expect full spell immunity // State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately // Ignore effects with mechanic, they are supposed to be checked separately
if (!spellInfo->Effects[i].IsEffect())
continue;
if (!IsImmunedToSpellEffect(spellInfo, i)) if (!IsImmunedToSpellEffect(spellInfo, i))
{ {
immuneToAllEffects = false; immuneToAllEffects = false;