mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Movement: add optional velocity argument for MoveLand and MoveTakeoff (PR #25516)
(cherry picked from commit 31abdc6ecf)
This commit is contained in:
@@ -672,23 +672,27 @@ void MotionMaster::MoveCloserAndStop(uint32 id, Unit* target, float distance)
|
||||
}
|
||||
}
|
||||
|
||||
void MotionMaster::MoveLand(uint32 id, Position const& pos)
|
||||
void MotionMaster::MoveLand(uint32 id, Position const& pos, Optional<float> velocity /*= {}*/)
|
||||
{
|
||||
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveLand: '%s', landing point Id: %u (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), id, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
|
||||
|
||||
Movement::MoveSplineInit init(_owner);
|
||||
init.MoveTo(PositionToVector3(pos), false);
|
||||
init.SetAnimation(AnimTier::Ground);
|
||||
if (velocity)
|
||||
init.SetVelocity(*velocity);
|
||||
Add(new GenericMovementGenerator(std::move(init), EFFECT_MOTION_TYPE, id));
|
||||
}
|
||||
|
||||
void MotionMaster::MoveTakeoff(uint32 id, Position const& pos)
|
||||
void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, Optional<float> velocity /*= {}*/)
|
||||
{
|
||||
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveTakeoff: '%s', landing point Id: %u (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), id, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
|
||||
|
||||
Movement::MoveSplineInit init(_owner);
|
||||
init.MoveTo(PositionToVector3(pos));
|
||||
init.MoveTo(PositionToVector3(pos), false);
|
||||
init.SetAnimation(AnimTier::Hover);
|
||||
if (velocity)
|
||||
init.SetVelocity(*velocity);
|
||||
Add(new GenericMovementGenerator(std::move(init), EFFECT_MOTION_TYPE, id));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user