Core/Spells: Fix bugged mass dispel after previous commits

This commit is contained in:
Kandera
2012-03-15 14:12:40 -04:00
parent fe46cf9796
commit 5406a0fd93
+7
View File
@@ -4941,6 +4941,12 @@ SpellCastResult Spell::CheckCast(bool strict)
bool hasDispellableAura = false; bool hasDispellableAura = false;
for (int i = 0; i < MAX_SPELL_EFFECTS; i++) for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL) if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL)
{
if (m_spellInfo->Effects[i].TargetA.IsArea() || m_spellInfo->Effects[i].TargetB.IsArea())
{
hasDispellableAura = true;
break;
}
if (Unit* target = m_targets.GetUnitTarget()) if (Unit* target = m_targets.GetUnitTarget())
{ {
DispelChargesList dispelList; DispelChargesList dispelList;
@@ -4952,6 +4958,7 @@ SpellCastResult Spell::CheckCast(bool strict)
break; break;
} }
} }
}
if (!hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) if (!hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))
return SPELL_FAILED_NOTHING_TO_DISPEL; return SPELL_FAILED_NOTHING_TO_DISPEL;