aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authorTrazom62 <none@none>2010-04-11 11:19:22 +0200
committerTrazom62 <none@none>2010-04-11 11:19:22 +0200
commitab6e30b9c811ce342bf3f7ede841f4db026fbec9 (patch)
tree3790a0a21083517501fdc1e2245562259f67d11e /src/game/Spell.cpp
parent49cf4f9b0c6960b47911afd8350f3849189d195f (diff)
Fix GCD in case of cast interrupt.
Fixes issue #1587. --HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 680cdac0f36..c4ca6756c16 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2783,13 +2783,11 @@ void Spell::cancel()
{
case SPELL_STATE_PREPARING:
case SPELL_STATE_DELAYED:
- {
SendInterrupted(0);
SendCastResult(SPELL_FAILED_INTERRUPTED);
- } break;
+ break;
case SPELL_STATE_CASTING:
- {
for (std::list<TargetInfo>::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
if ((*ihit).missCondition == SPELL_MISS_NONE)
if (Unit* unit = m_caster->GetGUID() == ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID))
@@ -2801,19 +2799,18 @@ void Spell::cancel()
// spell is canceled-take mods and clear list
if (m_caster->GetTypeId() == TYPEID_PLAYER)
- {
- m_caster->ToPlayer()->RemoveGlobalCooldown(m_spellInfo);
m_caster->ToPlayer()->RemoveSpellMods(this);
- }
m_appliedMods.clear();
- } break;
+ break;
default:
- {
- } break;
+ break;
}
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ m_caster->ToPlayer()->RemoveGlobalCooldown(m_spellInfo);
+
m_caster->RemoveDynObject(m_spellInfo->Id);
m_caster->RemoveGameObject(m_spellInfo->Id,true);