@@ 42,10 42,11 @@ public class WalkManager
/// </remarks>
/// <param name="x">The target x coordinate.</param>
/// <param name="y">The target y coordinate.</param>
+ /// <param name="allowUserActions">Whether to allow user actions during the walk operation.</param>
/// <param name="ct">The cancellation token used for cancelling the operation.</param>
/// <param name="petSelectors">The pet selectors to go with.</param>
/// <returns>A result that may not succeed.</returns>
- public async Task<Result> GoToAsync(short x, short y, CancellationToken ct = default, params int[] petSelectors)
+ public async Task<Result> GoToAsync(short x, short y, bool allowUserActions = true, CancellationToken ct = default, params int[] petSelectors)
{
var pathResult = _pathfinder.FindPathFromCurrent(x, y);
if (!pathResult.IsSuccess)
@@ 67,7 68,7 @@ public class WalkManager
}
var next = path.TakeForwardPath();
- var walkResult = await _client.SendCommandAsync(new WalkCommand(next.X, next.Y, petSelectors, 2), ct);
+ var walkResult = await _client.SendCommandAsync(new WalkCommand(next.X, next.Y, petSelectors, 2, AllowUserCancel: allowUserActions), ct);
if (!walkResult.IsSuccess)
{
if (path.ReachedEnd && walkResult.Error is WalkNotFinishedError walkNotFinishedError