@@ -803,10 +803,6 @@ void MotionMaster::MoveCharge(PathGenerator const& path, float speed /*= SPEED_C
803803
804804void MotionMaster::MoveKnockbackFrom (Position const & origin, float speedXY, float speedZ, float angle /* = M_PI*/ , Movement::SpellEffectExtraData const * spellEffectExtraData /* = nullptr*/ )
805805{
806- // This function may make players fall below map
807- if (_owner->GetTypeId () == TYPEID_PLAYER)
808- return ;
809-
810806 if (std::abs (speedXY) < 0 .01f && std::abs (speedZ) < 0 .01f )
811807 return ;
812808
@@ -1144,8 +1140,13 @@ void MotionMaster::MovePath(uint32 pathId, bool repeatable, Optional<Millisecond
11441140
11451141 TC_LOG_DEBUG (" movement.motionmaster" , " MotionMaster::MovePath: '{}', starts moving over path Id: {} (repeatable: {})" ,
11461142 _owner->GetGUID (), pathId, repeatable ? " YES" : " NO" );
1147- Add (new WaypointMovementGenerator<Creature>(pathId, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd,
1148- wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move (scriptResult)), MOTION_SLOT_DEFAULT);
1143+
1144+ if (_owner->GetTypeId () == TYPEID_UNIT)
1145+ Add (new WaypointMovementGenerator<Creature>(pathId, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd,
1146+ wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move (scriptResult)), MOTION_SLOT_DEFAULT);
1147+ else
1148+ Add (new WaypointMovementGenerator<Player>(pathId, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd,
1149+ wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move (scriptResult)), MOTION_SLOT_DEFAULT);
11491150}
11501151
11511152void 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<
11571158{
11581159 TC_LOG_DEBUG (" movement.motionmaster" , " MotionMaster::MovePath: '{}', starts moving over path Id: {} (repeatable: {})" ,
11591160 _owner->GetGUID (), path.Id , repeatable ? " YES" : " NO" );
1160- Add (new WaypointMovementGenerator<Creature>(path, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd,
1161- wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move (scriptResult)), MOTION_SLOT_DEFAULT);
1161+
1162+ if (_owner->GetTypeId () == TYPEID_UNIT)
1163+ Add (new WaypointMovementGenerator<Creature>(path, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd,
1164+ wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move (scriptResult)), MOTION_SLOT_DEFAULT);
1165+ else
1166+ Add (new WaypointMovementGenerator<Player>(path, repeatable, duration, speed, speedSelectionMode, waitTimeRangeAtPathEnd,
1167+ wanderDistanceAtPathEnds, followPathBackwardsFromEndToStart, exactSplinePath, generatePath, std::move (scriptResult)), MOTION_SLOT_DEFAULT);
11621168}
11631169
11641170void MotionMaster::MoveRotate (uint32 id, RotateDirection direction, Optional<Milliseconds> time /* = {}*/ ,
0 commit comments