aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authorthenecromancer <none@none>2009-05-28 23:05:52 +0200
committerthenecromancer <none@none>2009-05-28 23:05:52 +0200
commitbc55209b3e2723ef39935d6c4ff3f8b442b98f1c (patch)
tree2b10745a65c1b3fcc18bdf9fe06a651261f9d55f /src/game/Spell.cpp
parent39dd09532bb990f40e22cbbfd002f9b0aa24ef6f (diff)
Restore used spell mods if spell cast fails.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 66a237d9198..e9ab64f87d4 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -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)