Core/Spells: Correct check for starting cast while moving, thanks havenard for pointing out, fixes issue 3913

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-09-10 15:51:31 +03:00
parent 9ac9641429
commit 61075d5101

View File

@@ -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;
}