mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[9065] Implement motionmaster function UpdateFinalDistanceToTarget()
To update a creatures distance to it's target without creating a new movement generator. Note it can only be used where creature is using TargetedMovementGenerator. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
441aa50bad
commit
3c2327e6e0
6 changed files with 30 additions and 1 deletions
|
|
@ -463,3 +463,12 @@ bool MotionMaster::GetDestination(float &x, float &y, float &z)
|
|||
|
||||
return top()->GetDestination(x,y,z);
|
||||
}
|
||||
|
||||
void MotionMaster::UpdateFinalDistanceToTarget(float fDistance)
|
||||
{
|
||||
if (!empty())
|
||||
{
|
||||
if (top()->GetMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
top()->UpdateFinalDistance(fDistance);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue