Core/Movement: added a velocity argument for MoveSmoothPath motion master

This commit is contained in:
Ovahlord committed 2019-07-06 23:09:13 +02:00
1 parent f846a17c3e
commit b6cbd70533
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -509,7 +509,7 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool
init.Launch();
}
void MotionMaster::MoveSmoothPath(uint32 pointId, Position const* pathPoints, size_t pathSize, bool walk /*= false*/, bool fly /*= false*/)
void MotionMaster::MoveSmoothPath(uint32 pointId, Position const* pathPoints, size_t pathSize, bool walk /*= false*/, bool fly /*= false*/, float velocity /*= 0.0f*/)
{
Movement::MoveSplineInit init(_owner);
Movement::PointsArray path;
@@ -525,6 +525,9 @@ void MotionMaster::MoveSmoothPath(uint32 pointId, Position const* pathPoints, si
init.SetUncompressed();
}
if (velocity > 0.0f)
init.SetVelocity(velocity);
init.MovebyPath(path);
init.SetSmooth();
init.SetWalk(walk);