Compare commits

..

2 Commits

Author SHA1 Message Date
47d9f090a2
Handle zone transitiions in new movement logic 2024-08-30 14:00:10 +02:00
24c1e0c5d9
Version bump 2024-08-30 09:15:46 +02:00
2 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>2.17</Version> <Version>2.19</Version>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -169,6 +169,8 @@ internal static class MoveTo
private readonly Action _startAction; private readonly Action _startAction;
private readonly Vector3 _destination; private readonly Vector3 _destination;
private readonly MoveParams _moveParams; private readonly MoveParams _moveParams;
private readonly bool _isUnderwaterInitially;
private bool _canRestart;
public MoveInternal(MoveParams moveParams, public MoveInternal(MoveParams moveParams,
MovementController movementController, MovementController movementController,
@ -213,6 +215,7 @@ internal static class MoveTo
} }
_moveParams = moveParams; _moveParams = moveParams;
_canRestart = moveParams.RestartNavigation;
} }
public bool Start() public bool Start()
@ -231,13 +234,20 @@ internal static class MoveTo
if (movementStartedAt == DateTime.MaxValue || movementStartedAt.AddSeconds(2) >= DateTime.Now) if (movementStartedAt == DateTime.MaxValue || movementStartedAt.AddSeconds(2) >= DateTime.Now)
return ETaskResult.StillRunning; return ETaskResult.StillRunning;
if (_moveParams.RestartNavigation && if (_canRestart &&
Vector3.Distance(_clientState.LocalPlayer!.Position, _destination) > Vector3.Distance(_clientState.LocalPlayer!.Position, _destination) >
(_moveParams.StopDistance ?? QuestStep.DefaultStopDistance) + 5f) (_moveParams.StopDistance ?? QuestStep.DefaultStopDistance) + 5f)
{ {
_logger.LogInformation("Looks like movement was interrupted, re-attempting to move"); _canRestart = false;
_startAction(); if (_clientState.TerritoryType == _moveParams.TerritoryId)
return ETaskResult.StillRunning; {
_logger.LogInformation("Looks like movement was interrupted, re-attempting to move");
_startAction();
return ETaskResult.StillRunning;
}
else
_logger.LogInformation(
"Looks like movement was interrupted, do nothing since we're in a different territory now");
} }
return ETaskResult.TaskComplete; return ETaskResult.TaskComplete;