Core/Movement: some corrections on WaypointMovementGenerator

Port From (https://github.com/TrinityCore/TrinityCore/commit/88c3a184cc9cfd7457f5c4e5f743161c763cddf7)
This commit is contained in:
hondacrx
2021-02-18 12:34:38 -05:00
parent 94ac3b9777
commit 220914beca
@@ -251,17 +251,16 @@ namespace Game.Movement
} }
if (!_nextMoveTime.Passed()) if (!_nextMoveTime.Passed())
{
if (creature.MoveSpline.Finalized())
{ {
_nextMoveTime.Update((int)diff); _nextMoveTime.Update((int)diff);
if (_nextMoveTime.Passed()) if (_nextMoveTime.Passed())
return StartMoveNow(creature); return StartMoveNow(creature);
} }
}
else else
{ {
// Set home position at place on waypoint movement.
if (creature.GetTransGUID().IsEmpty())
creature.SetHomePosition(creature.GetPosition());
if (creature.MoveSpline.Finalized()) if (creature.MoveSpline.Finalized())
{ {
OnArrived(creature); OnArrived(creature);
@@ -270,12 +269,19 @@ namespace Game.Movement
if (_nextMoveTime.Passed()) if (_nextMoveTime.Passed())
return StartMove(creature); return StartMove(creature);
} }
else if (_recalculateSpeed) else
{
// Set home position at place on waypoint movement.
if (creature.GetTransGUID().IsEmpty())
creature.SetHomePosition(creature.GetPosition());
if (_recalculateSpeed)
{ {
if (_nextMoveTime.Passed()) if (_nextMoveTime.Passed())
StartMove(creature); StartMove(creature);
} }
} }
}
return true; return true;
} }