Core/Spells: Fix immunity checking for creatures (i.e. Mind Control)

This commit is contained in:
Elron103
2012-05-18 22:15:21 +02:00
parent 7e62c34b24
commit 881138553b
@@ -1668,8 +1668,8 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
if (!spellInfo)
return false;
// Spells that don't have effectMechanics.
if (!spellInfo->HasAnyEffectMechanic() && GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
// Creature is immune to main mechanic of the spell
if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
return true;
// This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break