Restore used spell mods if spell cast fails.

--HG--
branch : trunk
This commit is contained in:
thenecromancer committed 2009-05-28 23:05:52 +02:00
1 parent 39dd09532b
commit bc55209b3e
3 files changed
+30 -3

No files matched your search

+7 -2
View File
@@ -2720,9 +2720,14 @@ void Spell::finish(bool ok)
if(!m_caster->IsNonMeleeSpellCasted(false, false, true))
m_caster->clearUnitState(UNIT_STAT_CASTING);
if(!ok)
{
//restore spell mods
if (m_caster->GetTypeId() == TYPEID_PLAYER)
((Player*)m_caster)->RestoreSpellMods(this);
return;
}
// other code related only to successfully finished spells
if(!ok)
return;
//remove spell mods
if (m_caster->GetTypeId() == TYPEID_PLAYER)