Core/Units: Update facing spline movement immediately after launching

Port From (https://github.com/TrinityCore/TrinityCore/commit/6c15fb00e5b7cf39cd6dc97c302418710bc21212)
This commit is contained in:
hondacrx
2024-02-27 13:38:28 -05:00
parent ebcf5696b9
commit d18e3b4b82
+12 -3
View File
@@ -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)