mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: make Spell::CheckMovement respect the current spell state (#28315)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user