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

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

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);

View File

@@ -185,7 +185,7 @@ class TC_GAME_API MotionMaster
}
void MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id = EVENT_JUMP, bool hasOrientation = false);
void MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount);
void MoveSmoothPath(uint32 pointId, Position const* pathPoints, size_t pathSize, bool walk = false, bool fly = false);
void MoveSmoothPath(uint32 pointId, Position const* pathPoints, size_t pathSize, bool walk = false, bool fly = false, float velocity = 0.0f);
// Walk along spline chain stored in DB (script_spline_chain_meta and script_spline_chain_waypoints)
void MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk);
void MoveAlongSplineChain(uint32 pointId, std::vector<SplineChainLink> const& chain, bool walk);