Core/Spells: Fixed crash in spell effect immunity check

Closes #16299
This commit is contained in:
Shauren
2016-01-17 12:52:58 +01:00
parent 09adf4d0ad
commit dfceb3dd19
+5 -1
View File
@@ -1818,12 +1818,16 @@ void Player::RemoveFromWorld()
bool Player::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const
{
SpellEffectInfo const* effect = spellInfo->GetEffect(GetMap()->GetDifficultyID(), index);
if (!effect || !effect->IsEffect())
return false;
// players are immune to taunt (the aura and the spell effect).
if (spellInfo->GetEffect(index)->IsAura(SPELL_AURA_MOD_TAUNT))
return true;
if (spellInfo->GetEffect(index)->IsEffect(SPELL_EFFECT_ATTACK_ME))
return true;
return Unit::IsImmunedToSpellEffect(spellInfo, index);
}