Core/Movement: only set velocity values for follow movement if we have to rely on our follow target's speed
This commit is contained in:
1 parent
0d84daa39c
commit
479437f8d6
1 file changed
+3
-4
@@ -116,12 +116,10 @@ bool FollowMovementGenerator::Update(Unit* owner, uint32 diff)
|
|||||||
velocity = target->GetSpeed(MOVE_RUN);
|
velocity = target->GetSpeed(MOVE_RUN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
velocity = owner->IsWalking() ? owner->GetSpeed(MOVE_WALK) : owner->GetSpeed(MOVE_RUN);
|
|
||||||
|
|
||||||
// Follow target based speed allignment
|
// Follow target based speed allignment
|
||||||
float distance = owner->GetExactDist2d(dest);
|
float distance = owner->GetExactDist2d(dest);
|
||||||
if (_useTargetSpeed)
|
if (_useTargetSpeed && velocity > 0.f)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Determine catchup speed rate
|
// Determine catchup speed rate
|
||||||
@@ -144,7 +142,8 @@ bool FollowMovementGenerator::Update(Unit* owner, uint32 diff)
|
|||||||
|
|
||||||
Movement::MoveSplineInit init(owner);
|
Movement::MoveSplineInit init(owner);
|
||||||
init.MoveTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
|
init.MoveTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
|
||||||
init.SetVelocity(velocity);
|
if (velocity > 0.f)
|
||||||
|
init.SetVelocity(velocity);
|
||||||
init.Launch();
|
init.Launch();
|
||||||
|
|
||||||
_hasStopped = false;
|
_hasStopped = false;
|
||||||
|
|||||||
Reference in new issue
Block a user