aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2022-10-03 15:52:49 +0200
committerGitHub <noreply@github.com>2022-10-03 15:52:49 +0200
commitad2df01b2c25ca6264096b8b8324dc8136ebd48b (patch)
tree2b4fbf2c9216a33c8dac53ceaa54064f2d4faaa1 /src
parent769591c99ef7bd9c58eacd5c0272387af9a74e4a (diff)
Core/Spells: make Spell::CheckMovement respect the current spell state (#28315)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp14
1 files changed, 6 insertions, 8 deletions
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;
- }
}
}