Fix added check for IsImmunedToSpell

Signed-off-by: dr.skull <dr.skull@centrum.sk>
This commit is contained in:
dr.skull
2012-06-17 23:17:59 +02:00
parent 3f8efb21cd
commit b5a072855e
2 changed files with 6 additions and 6 deletions

View File

@@ -1675,10 +1675,10 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
// This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break
// the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data.
bool immunedToAllEffects = true;
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if(!spellInfo->Effects[i].IsEffect())
break;
if (!spellInfo->Effects[i].IsEffect())
continue;
if (!IsImmunedToSpellEffect(spellInfo, i))
{
immunedToAllEffects = false;

View File

@@ -11534,12 +11534,12 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
}
bool immuneToAllEffects = true;
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately
if(!spellInfo->Effects[i].IsEffect())
break;
if (!spellInfo->Effects[i].IsEffect())
continue;
if (!IsImmunedToSpellEffect(spellInfo, i))
{
immuneToAllEffects = false;