Core/Spells: fix Global Cooldown reset on spell cast interrupt.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user