mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Movement: Migrate scripts using GetMotionMaster()->MoveSmoothPath to GetMotionMaster()->MovePath and kill it (they now have the same capabilities)
This commit is contained in:
@@ -990,32 +990,6 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool
|
||||
Add(new GenericMovementGenerator(std::move(initializer), EFFECT_MOTION_TYPE, 0, { .Duration = duration, .ScriptResult = std::move(scriptResult) }));
|
||||
}
|
||||
|
||||
void MotionMaster::MoveSmoothPath(uint32 pointId, Position const* pathPoints, size_t pathSize, bool walk, bool fly)
|
||||
{
|
||||
Movement::PointsArray path;
|
||||
path.reserve(pathSize);
|
||||
std::transform(pathPoints, pathPoints + pathSize, std::back_inserter(path), [](Position const& point)
|
||||
{
|
||||
return G3D::Vector3(point.GetPositionX(), point.GetPositionY(), point.GetPositionZ());
|
||||
});
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=](Movement::MoveSplineInit& init)
|
||||
{
|
||||
init.MovebyPath(path);
|
||||
init.SetWalk(walk);
|
||||
if (fly)
|
||||
{
|
||||
init.SetFly();
|
||||
init.SetUncompressed();
|
||||
init.SetSmooth();
|
||||
}
|
||||
};
|
||||
|
||||
// This code is not correct
|
||||
// GenericMovementGenerator does not affect UNIT_STATE_ROAMING_MOVE
|
||||
// need to call PointMovementGenerator with various pointIds
|
||||
Add(new GenericMovementGenerator(std::move(initializer), EFFECT_MOTION_TYPE, pointId));
|
||||
}
|
||||
|
||||
void MotionMaster::MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk)
|
||||
{
|
||||
Creature* owner = _owner->ToCreature();
|
||||
|
||||
Reference in New Issue
Block a user