diff options
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 562459dab37..dbf9966ae51 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3006,6 +3006,17 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere m_casttime = GetSpellCastTime(m_spellInfo, this); //m_caster->ModSpellCastTime(m_spellInfo, m_casttime, this); + // don't allow channeled spells / spells with cast time to be casted while moving + // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) + if ((IsChanneledSpell(m_spellInfo) || m_casttime) + && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() + && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) + { + SendCastResult(SPELL_FAILED_MOVING); + finish(false); + return; + } + // set timer base at cast time ReSetTimer(); @@ -5739,13 +5750,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (!plrCaster->GetComboPoints()) return SPELL_FAILED_NO_COMBO_POINTS; - // don't allow channeled spells / spells with cast time to be casted while moving - // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) - if ((IsChanneledSpell(m_spellInfo) || GetSpellCastTime(m_spellInfo, this)) - && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() - && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) - return SPELL_FAILED_MOVING; - // all ok return SPELL_CAST_OK; } |