aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimonDMII <simonlathuile@hotmail.it>2011-04-11 16:35:31 +0600
committerAzazel <azazel.kon@gmail.com>2011-04-11 16:35:31 +0600
commite38634186c295a0de26b30787a221689debc5c11 (patch)
tree9efce21d1bb62411169942e9317c8cf118898fe2 /src
parent5357b1ba7773801bff66c3bbffe3d2b7c73847ad (diff)
Core/Spells: fix Global Cooldown reset on spell cast interrupt.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp8
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp8
2 files changed, 7 insertions, 9 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 70cc81c9070..338261af3ad 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2981,17 +2981,15 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
if (!spell->IsInterruptable())
return;
- m_currentSpells[spellType] = NULL;
-
// send autorepeat cancel message for autorepeat spells
if (spellType == CURRENT_AUTOREPEAT_SPELL)
- {
if (GetTypeId() == TYPEID_PLAYER)
- this->ToPlayer()->SendAutoRepeatCancel(this);
- }
+ ToPlayer()->SendAutoRepeatCancel(this);
if (spell->getState() != SPELL_STATE_FINISHED)
spell->cancel();
+
+ m_currentSpells[spellType] = NULL;
spell->SetReferencedFromCurrent(false);
}
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 7217a492e62..4f2c69f6353 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3015,10 +3015,6 @@ void Spell::cancel()
if (m_spellState == SPELL_STATE_FINISHED)
return;
- SetReferencedFromCurrent(false);
- if (m_selfContainer && *m_selfContainer == this)
- *m_selfContainer = NULL;
-
uint32 oldState = m_spellState;
m_spellState = SPELL_STATE_FINISHED;
@@ -3053,6 +3049,10 @@ void Spell::cancel()
break;
}
+ SetReferencedFromCurrent(false);
+ if (m_selfContainer && *m_selfContainer == this)
+ *m_selfContainer = NULL;
+
if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->RemoveGlobalCooldown(m_spellInfo);