diff options
author | Shocker <none@none> | 2010-09-10 15:51:31 +0300 |
---|---|---|
committer | Shocker <none@none> | 2010-09-10 15:51:31 +0300 |
commit | 61075d5101283cc6d485018a40e02b2c44f27ebf (patch) | |
tree | 304fe86a07cb1fa6ade2bff8803ed5e366829b57 | |
parent | 9ac964142969056dab825f9f6883c75ef53f1c90 (diff) |
Core/Spells: Correct check for starting cast while moving, thanks havenard for pointing out, fixes issue 3913
--HG--
branch : trunk
-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; } |