From 62b825f8bd5724e714fe688b62336ee6feff87d0 Mon Sep 17 00:00:00 2001 From: Saqra1 <161769195+Saqra1@users.noreply.github.com> Date: Sun, 1 Sep 2024 18:57:17 -0500 Subject: [PATCH] fix(Core/Movement): Don't move for change in orientation only (#19687) Changing only the orientation of a unit also flags it as if it were moving, which causes spells to be interrupted. --- src/server/game/Movement/Spline/MoveSplineInit.cpp | 4 +++- src/server/game/Spells/SpellEffects.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index faf6cd203..c2f6664b6 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -101,7 +101,9 @@ namespace Movement moveFlags = (moveFlags & ~(MOVEMENTFLAG_FORWARD)) | MOVEMENTFLAG_BACKWARD; } - if (moveFlags & MOVEMENTFLAG_ROOT) + bool isOrientationOnly = args.path.size() == 2 && args.path[0] == args.path[1]; + + if ((moveFlags & MOVEMENTFLAG_ROOT) || isOrientationOnly) moveFlags &= ~MOVEMENTFLAG_MASK_MOVING; if (!args.HasVelocity) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index fc118371b..293557bd2 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2677,7 +2677,7 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING)) return; - unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget)); /// @BUG Causes the player to stop moving + interrupts spellcast. + unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget)); /// @BUG Causes the player to stop moving. unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS); }