aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShocker <none@none>2010-09-08 04:15:41 +0300
committerShocker <none@none>2010-09-08 04:15:41 +0300
commit948c1f0fd666b2fdf6bcf98051d0e9a65f358d43 (patch)
tree52e57e78209bddfd29b5f1577b4facce014cf901 /src
parent5f3ec4366d10582b2e35777725308432515994b8 (diff)
Core/Spells: Add server-side check for not allowing non-instant spells with movement interrupt flag to be casted while moving
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 309ecfdd853..f412e594e33 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5732,6 +5732,13 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_needComboPoints && m_caster->ToPlayer() && !m_caster->ToPlayer()->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;
}