mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +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
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue