mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Fix GCD in case of cast interrupt.
Fixes issue #1587. --HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user