From d18e3b4b8276ef169378c7b25c1717a91e8fcf59 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 27 Feb 2024 13:38:28 -0500 Subject: [PATCH] Core/Units: Update facing spline movement immediately after launching Port From (https://github.com/TrinityCore/TrinityCore/commit/6c15fb00e5b7cf39cd6dc97c302418710bc21212) --- Source/Game/Entities/Unit/Unit.Movement.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index c4b4d3d0c..c2975d984 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -217,7 +217,10 @@ namespace Game.Entities init.SetFacing(ori); //GetMotionMaster().LaunchMoveSpline(init, EventId.Face, MovementGeneratorPriority.Highest); - init.Launch(); + UpdateSplineMovement((uint)init.Launch()); + Creature creature = ToCreature(); + if (creature != null) + creature.GetAI().MovementInform(MovementGeneratorType.Effect, EventId.Face); } public void SetFacingToObject(WorldObject obj, bool force = true) @@ -232,7 +235,10 @@ namespace Game.Entities init.SetFacing(GetAbsoluteAngle(obj)); // when on transport, GetAbsoluteAngle will still return global coordinates (and angle) that needs transforming //GetMotionMaster().LaunchMoveSpline(init, EventId.Face, MovementGeneratorPriority.Highest); - init.Launch(); + UpdateSplineMovement((uint)init.Launch()); + Creature creature = ToCreature(); + if (creature != null) + creature.GetAI().MovementInform(MovementGeneratorType.Effect, EventId.Face); } void SetFacingToPoint(Position point, bool force = true) @@ -249,7 +255,10 @@ namespace Game.Entities init.SetFacing(point.GetPositionX(), point.GetPositionY(), point.GetPositionZ()); //GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_FACE, MOTION_PRIORITY_HIGHEST); - init.Launch(); + UpdateSplineMovement((uint)init.Launch()); + Creature creature = ToCreature(); + if (creature != null) + creature.GetAI().MovementInform(MovementGeneratorType.Effect, EventId.Face); } public void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false)