Core/Spells: make Spell::CheckMovement respect the current spell state
Port From (https://github.com/TrinityCore/TrinityCore/commit/ad2df01b2c25ca6264096b8b8324dc8136ebd48b)
This commit is contained in:
@@ -7827,17 +7827,13 @@ namespace Game.Spells
|
||||
{
|
||||
if (!unitCaster.CanCastSpellWhileMoving(m_spellInfo))
|
||||
{
|
||||
if (m_casttime != 0)
|
||||
if (GetState() == SpellState.Preparing)
|
||||
{
|
||||
if (m_spellInfo.InterruptFlags.HasFlag(SpellInterruptFlags.Movement))
|
||||
return SpellCastResult.Moving;
|
||||
}
|
||||
else
|
||||
{
|
||||
// only fail channeled casts if they are instant but cannot be channeled while moving
|
||||
if (m_spellInfo.IsChanneled() && !m_spellInfo.IsMoveAllowedChannel())
|
||||
if (m_casttime > 0 && m_spellInfo.InterruptFlags.HasFlag(SpellInterruptFlags.Movement))
|
||||
return SpellCastResult.Moving;
|
||||
}
|
||||
else if (GetState() == SpellState.Casting && !m_spellInfo.IsMoveAllowedChannel())
|
||||
return SpellCastResult.Moving;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user