Core/Movement: implement optional velocity argument to MoveLand motion master helper
This commit is contained in:
1 parent
90d0167ace
commit
53060a39f5
2 files changed
+4
-2
No files matched your search
@@ -338,7 +338,7 @@ 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 /*= nullptr*/)
|
||||
{
|
||||
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());
|
||||
|
||||
@@ -347,6 +347,8 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos)
|
||||
init.SetSmooth();
|
||||
init.SetFly();
|
||||
init.SetAnimation(Movement::ToGround);
|
||||
if (velocity)
|
||||
init.SetVelocity(velocity.get());
|
||||
Mutate(new GenericMovementGenerator(std::move(init), EFFECT_MOTION_TYPE, id), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user