Core/Creatures: Improved movement interruption while casting spells

Port From (https://github.com/TrinityCore/TrinityCore/commit/cc57c9dad59a2eded2f7ea0471aa79c89b390559)
This commit is contained in:
hondacrx
2023-04-05 08:03:07 -04:00
parent 6b8dc37d3c
commit 1cf184978e
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -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)
{