Core/Spells: Fix a crash on checking school immunity added to unit manually (not by aura)

This commit is contained in:
QAston
2011-07-28 23:41:29 +02:00
parent 045dec19fa
commit 07badd7385
9 changed files with 485 additions and 168 deletions
+3 -3
View File
@@ -11578,10 +11578,10 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
{
SpellInfo const* inmmuneSpellInfo = sSpellMgr->GetSpellInfo(itr->spellId);
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->spellId);
if ((itr->type & spellInfo->GetSchoolMask())
&& !(inmmuneSpellInfo->IsPositive() && spellInfo->IsPositive())
&& !spellInfo->CanPierceImmuneAura(inmmuneSpellInfo))
&& !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive())
&& !spellInfo->CanPierceImmuneAura(immuneSpellInfo))
return true;
}
}