From ad2df01b2c25ca6264096b8b8324dc8136ebd48b Mon Sep 17 00:00:00 2001 From: Ovah Date: Mon, 3 Oct 2022 15:52:49 +0200 Subject: Core/Spells: make Spell::CheckMovement respect the current spell state (#28315) --- src/server/game/Spells/Spell.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 17d8db166ef..8e29980fe83 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6860,17 +6860,15 @@ SpellCastResult Spell::CheckMovement() const { if (!unitCaster->CanCastSpellWhileMoving(m_spellInfo)) { - if (m_casttime) + if (getState() == SPELL_STATE_PREPARING) { - if (m_spellInfo->InterruptFlags.HasFlag(SpellInterruptFlags::Movement)) - return SPELL_FAILED_MOVING; + if (m_casttime > 0) + if (m_spellInfo->InterruptFlags.HasFlag(SpellInterruptFlags::Movement)) + return SPELL_FAILED_MOVING; } - else - { - // only fail channeled casts if they are instant but cannot be channeled while moving - if (m_spellInfo->IsChanneled() && !m_spellInfo->IsMoveAllowedChannel()) + else if (getState() == SPELL_STATE_CASTING) + if (!m_spellInfo->IsMoveAllowedChannel()) return SPELL_FAILED_MOVING; - } } } -- cgit v1.2.3