Core/Creatures: Improved movement interruption while casting spells
Port From (https://github.com/TrinityCore/TrinityCore/commit/cc57c9dad59a2eded2f7ea0471aa79c89b390559)
This commit is contained in:
@@ -1047,7 +1047,8 @@ namespace Game.Entities
|
||||
|
||||
Spell spell = GetCurrentSpell(CurrentSpellTypes.Generic);
|
||||
if (spell != null)
|
||||
if (CanCastSpellWhileMoving(spell.GetSpellInfo()))
|
||||
if (CanCastSpellWhileMoving(spell.GetSpellInfo()) || spell.GetState() == SpellState.Finished ||
|
||||
!spell.m_spellInfo.InterruptFlags.HasFlag(SpellInterruptFlags.Movement))
|
||||
return false;
|
||||
|
||||
// channeled spells during channel stage (after the initial cast timer) allow movement with a specific spell attribute
|
||||
|
||||
@@ -7809,6 +7809,12 @@ namespace Game.Spells
|
||||
if (IsTriggered())
|
||||
return SpellCastResult.SpellCastOk;
|
||||
|
||||
// Creatures (not controlled) give priority to spell casting over movement.
|
||||
// We assume that the casting is always valid and the current movement
|
||||
// is stopped by Unit:IsmovementPreventedByCasting to prevent casting interruption.
|
||||
if (m_caster.IsCreature() && !m_caster.ToCreature().IsControlledByPlayer())
|
||||
return SpellCastResult.SpellCastOk;
|
||||
|
||||
Unit unitCaster = m_caster.ToUnit();
|
||||
if (unitCaster != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user