Core/Spells: Add server-side check for not allowing non-instant spells with movement interrupt flag to be casted while moving

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-09-08 04:15:41 +03:00
parent 5f3ec4366d
commit 948c1f0fd6
+7
View File
@@ -5732,6 +5732,13 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_needComboPoints && m_caster->ToPlayer() && !m_caster->ToPlayer()->GetComboPoints()) if (m_needComboPoints && m_caster->ToPlayer() && !m_caster->ToPlayer()->GetComboPoints())
return SPELL_FAILED_NO_COMBO_POINTS; 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 // all ok
return SPELL_CAST_OK; return SPELL_CAST_OK;
} }