From 1c565c0db177ce544671b69643583f96497f4ecd Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 21 Apr 2024 00:16:57 +0200 Subject: Core/Movement: Implemented alternative method of smoothing waypoint paths (send new point 1.5 before arrival) and make that the default * Sending whole path at once is still supported with WaypointPathFlags::ExactSplinePath (cherry picked from commit cf1ab7b4142f1d070d999c4141109a6c6c46d06d) --- src/server/game/Movement/MotionMaster.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/server/game/Movement/MotionMaster.cpp') diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index aec3bc208a8..e60f30741b6 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -1157,7 +1157,8 @@ void MotionMaster::MoveDistract(uint32 timer, float orientation) void MotionMaster::MovePath(uint32 pathId, bool repeatable, Optional duration /*= {}*/, Optional speed /*= {}*/, MovementWalkRunSpeedSelectionMode speedSelectionMode /*= MovementWalkRunSpeedSelectionMode::Default*/, Optional> waitTimeRangeAtPathEnd /*= {}*/, - Optional wanderDistanceAtPathEnds /*= {}*/, Optional followPathBackwardsFromEndToStart /*= {}*/, bool generatePath /*= true*/, + Optional wanderDistanceAtPathEnds /*= {}*/, Optional followPathBackwardsFromEndToStart /*= {}*/, + Optional exactSplinePath /*= {}*/, bool generatePath /*= true*/, Optional>&& scriptResult /*= {}*/) { if (!pathId) @@ -1170,19 +1171,20 @@ void MotionMaster::MovePath(uint32 pathId, bool repeatable, OptionalGetGUID(), pathId, repeatable ? "YES" : "NO"); Add(new WaypointMovementGenerator(pathId, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd, - wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); + wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); } void MotionMaster::MovePath(WaypointPath const& path, bool repeatable, Optional duration /*= {}*/, Optional speed /*= {}*/, MovementWalkRunSpeedSelectionMode speedSelectionMode /*= MovementWalkRunSpeedSelectionMode::Default*/, Optional> waitTimeRangeAtPathEnd /*= {}*/, - Optional wanderDistanceAtPathEnds /*= {}*/, Optional followPathBackwardsFromEndToStart /*= {}*/, bool generatePath /*= true*/, + Optional wanderDistanceAtPathEnds /*= {}*/, Optional followPathBackwardsFromEndToStart /*= {}*/, + Optional exactSplinePath /*= {}*/, bool generatePath /*= true*/, Optional>&& scriptResult /*= {}*/) { TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MovePath: '{}', starts moving over path Id: {} (repeatable: {})", _owner->GetGUID(), path.Id, repeatable ? "YES" : "NO"); Add(new WaypointMovementGenerator(path, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd, - wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); + wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); } void MotionMaster::MoveRotate(uint32 id, RotateDirection direction, Optional time /*= {}*/, -- cgit v1.2.3