[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:
NoFantasy 2009-12-25 18:06:22 +01:00
parent 441aa50bad
commit 3c2327e6e0
6 changed files with 30 additions and 1 deletions

View file

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