Merge pull request #6548 from Elron103/pull-requests

Core/Spells: Fix immunity checking for creatures (i.e. Mind Control)
This commit is contained in:
kandera
2012-05-22 05:55:27 -07:00
@@ -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