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())
|
if (!spell->IsInterruptable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_currentSpells[spellType] = NULL;
|
|
||||||
|
|
||||||
// send autorepeat cancel message for autorepeat spells
|
// send autorepeat cancel message for autorepeat spells
|
||||||
if (spellType == CURRENT_AUTOREPEAT_SPELL)
|
if (spellType == CURRENT_AUTOREPEAT_SPELL)
|
||||||
{
|
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
this->ToPlayer()->SendAutoRepeatCancel(this);
|
ToPlayer()->SendAutoRepeatCancel(this);
|
||||||
}
|
|
||||||
|
|
||||||
if (spell->getState() != SPELL_STATE_FINISHED)
|
if (spell->getState() != SPELL_STATE_FINISHED)
|
||||||
spell->cancel();
|
spell->cancel();
|
||||||
|
|
||||||
|
m_currentSpells[spellType] = NULL;
|
||||||
spell->SetReferencedFromCurrent(false);
|
spell->SetReferencedFromCurrent(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3015,10 +3015,6 @@ void Spell::cancel()
|
|||||||
if (m_spellState == SPELL_STATE_FINISHED)
|
if (m_spellState == SPELL_STATE_FINISHED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SetReferencedFromCurrent(false);
|
|
||||||
if (m_selfContainer && *m_selfContainer == this)
|
|
||||||
*m_selfContainer = NULL;
|
|
||||||
|
|
||||||
uint32 oldState = m_spellState;
|
uint32 oldState = m_spellState;
|
||||||
m_spellState = SPELL_STATE_FINISHED;
|
m_spellState = SPELL_STATE_FINISHED;
|
||||||
|
|
||||||
@@ -3053,6 +3049,10 @@ void Spell::cancel()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetReferencedFromCurrent(false);
|
||||||
|
if (m_selfContainer && *m_selfContainer == this)
|
||||||
|
*m_selfContainer = NULL;
|
||||||
|
|
||||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
m_caster->ToPlayer()->RemoveGlobalCooldown(m_spellInfo);
|
m_caster->ToPlayer()->RemoveGlobalCooldown(m_spellInfo);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user