diff options
author | Ovahlord <dreadkiller@gmx.de> | 2024-02-25 15:12:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 15:12:46 +0100 |
commit | 6c15fb00e5b7cf39cd6dc97c302418710bc21212 (patch) | |
tree | faf2ef6d67e53b30a5a68ef6ed9cfbe4d7fa5f7b | |
parent | 7465ce9aeb4ae60b45b09416e1c4d0556218600c (diff) |
Core/Units: Update facing spline movement immediately after launching (#29494)
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c19f5f1c05c..b67e15cdc0c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12582,7 +12582,9 @@ void Unit::SetFacingTo(float ori, bool force) init.SetFacing(ori); //GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_FACE, MOTION_PRIORITY_HIGHEST); - init.Launch(); + UpdateSplineMovement(init.Launch()); + if (Creature* creature = ToCreature()) + creature->AI()->MovementInform(EFFECT_MOTION_TYPE, EVENT_FACE); } void Unit::SetFacingToObject(WorldObject const* object, bool force) @@ -12597,7 +12599,9 @@ void Unit::SetFacingToObject(WorldObject const* object, bool force) init.SetFacing(GetAbsoluteAngle(object)); // when on transport, GetAbsoluteAngle will still return global coordinates (and angle) that needs transforming //GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_FACE, MOTION_PRIORITY_HIGHEST); - init.Launch(); + UpdateSplineMovement(init.Launch()); + if (Creature* creature = ToCreature()) + creature->AI()->MovementInform(EFFECT_MOTION_TYPE, EVENT_FACE); } void Unit::SetFacingToPoint(Position const& point, bool force) @@ -12614,7 +12618,9 @@ void Unit::SetFacingToPoint(Position const& point, bool force) init.SetFacing(point.GetPositionX(), point.GetPositionY(), point.GetPositionZ()); //GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_FACE, MOTION_PRIORITY_HIGHEST); - init.Launch(); + UpdateSplineMovement(init.Launch()); + if (Creature* creature = ToCreature()) + creature->AI()->MovementInform(EFFECT_MOTION_TYPE, EVENT_FACE); } bool Unit::SetWalk(bool enable) |