diff options
| author | Shauren <shauren.trinity@gmail.com> | 2026-01-05 14:18:45 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2026-01-05 14:18:45 +0100 |
| commit | 1db1a0e57f2cec54dd59e339f731695d16261f3e (patch) | |
| tree | 616d3b8d44d73c4350b367a877d9b01db1ad56d9 /src/server/game/Movement/MotionMaster.cpp | |
| parent | 1f1c859a477f2bb4573521f0e12322c34017e95d (diff) | |
Core/Movement: Enable MotionMaster::MovePath for players
Diffstat (limited to 'src/server/game/Movement/MotionMaster.cpp')
| -rw-r--r-- | src/server/game/Movement/MotionMaster.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index d33e418c51f..bf2d2669d7d 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -803,10 +803,6 @@ void MotionMaster::MoveCharge(PathGenerator const& path, float speed /*= SPEED_C void MotionMaster::MoveKnockbackFrom(Position const& origin, float speedXY, float speedZ, float angle /*= M_PI*/, Movement::SpellEffectExtraData const* spellEffectExtraData /*= nullptr*/) { - // This function may make players fall below map - if (_owner->GetTypeId() == TYPEID_PLAYER) - return; - if (std::abs(speedXY) < 0.01f && std::abs(speedZ) < 0.01f) return; @@ -1144,8 +1140,13 @@ void MotionMaster::MovePath(uint32 pathId, bool repeatable, Optional<Millisecond TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MovePath: '{}', starts moving over path Id: {} (repeatable: {})", _owner->GetGUID(), pathId, repeatable ? "YES" : "NO"); - Add(new WaypointMovementGenerator<Creature>(pathId, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd, - wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); + + if (_owner->GetTypeId() == TYPEID_UNIT) + Add(new WaypointMovementGenerator<Creature>(pathId, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd, + wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); + else + Add(new WaypointMovementGenerator<Player>(pathId, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd, + wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); } void MotionMaster::MovePath(WaypointPath const& path, bool repeatable, Optional<Milliseconds> duration /*= {}*/, Optional<float> speed /*= {}*/, @@ -1157,8 +1158,13 @@ void MotionMaster::MovePath(WaypointPath const& path, bool repeatable, Optional< { TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MovePath: '{}', starts moving over path Id: {} (repeatable: {})", _owner->GetGUID(), path.Id, repeatable ? "YES" : "NO"); - Add(new WaypointMovementGenerator<Creature>(path, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd, - wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); + + if (_owner->GetTypeId() == TYPEID_UNIT) + Add(new WaypointMovementGenerator<Creature>(path, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd, + wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); + else + Add(new WaypointMovementGenerator<Player>(path, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd, + wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move(scriptResult)), MOTION_SLOT_DEFAULT); } void MotionMaster::MoveRotate(uint32 id, RotateDirection direction, Optional<Milliseconds> time /*= {}*/, |
