Core/Spells: finish fixing dispel functionality. closes #5745

This commit is contained in:
Kandera
2012-03-16 17:59:10 -04:00
parent 23c5ce0e0a
commit aad4e41ca5
+7 -1
View File
@@ -4956,6 +4956,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return castResult;
bool hasDispellableAura = false;
bool hasNonDispelEffect = false;
for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL)
{
@@ -4976,8 +4977,13 @@ SpellCastResult Spell::CheckCast(bool strict)
}
}
}
else if (m_spellInfo->Effects[i].IsEffect())
{
hasNonDispelEffect = true;
break;
}
if (!hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))
if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))
return SPELL_FAILED_NOTHING_TO_DISPEL;
for (int i = 0; i < MAX_SPELL_EFFECTS; i++)