[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

@ -102,6 +102,19 @@ void TargetedMovementGenerator<Creature>::Initialize(Creature &owner)
_setTargetLocation(owner);
}
template<>
void TargetedMovementGenerator<Player>::UpdateFinalDistance(float fDistance)
{
// nothing to do for Player
}
template<>
void TargetedMovementGenerator<Creature>::UpdateFinalDistance(float fDistance)
{
i_offset = fDistance;
i_recalculateTravel = true;
}
template<>
void TargetedMovementGenerator<Player>::Initialize(Player &owner)
{