Skip to content

Commit

Permalink
Make it explicit that taur's new IPC is a fucking hammer that kills e…
Browse files Browse the repository at this point in the history
…verything alive.
  • Loading branch information
awgil committed Mar 6, 2024
1 parent ce6c5f8 commit 20923f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion vnavmesh/IPCProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public IPCProvider(NavmeshManager navmeshManager, FollowPath followPath, AsyncMo
RegisterFunc("Nav.Rebuild", () => navmeshManager.Reload(false));
RegisterFunc("Nav.Pathfind", (Vector3 from, Vector3 to, bool fly) => navmeshManager.QueryPath(from, to, fly));
RegisterFunc("Nav.PathfindCancelable", (Vector3 from, Vector3 to, bool fly, CancellationToken cancel) => navmeshManager.QueryPath(from, to, fly, cancel));
RegisterAction("Nav.PathfindCancelCurrent", () => navmeshManager.CancelCurrentPathfinding());
RegisterAction("Nav.PathfindCancelAll", navmeshManager.CancelAllQueries);
RegisterFunc("Nav.PathfindInProgress", () => navmeshManager.PathfindInProgress);
RegisterFunc("Nav.PathfindNumQueued", () => navmeshManager.NumQueuedPathfindRequests);
RegisterFunc("Nav.IsAutoLoad", () => navmeshManager.AutoLoad);
Expand Down
10 changes: 5 additions & 5 deletions vnavmesh/NavmeshManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,17 @@ public bool Reload(bool allowLoadFromCache)
return task;
}

public void CancelCurrentPathfinding()
public void CancelAllQueries()
{
if (_queryCancelSource == null || _currentPathfindTask is null || _query == null)
if (_queryCancelSource == null)
{
Service.Log.Error($"Can't cancel query - navmesh is not loaded");
Service.Log.Error($"Can't cancel queries - navmesh is not loaded");
return;
}

_queryCancelSource.Cancel(); // this will cancel current pathfind task
_queryCancelSource.Cancel(); // this will cancel current and all queued pathfind tasks
_queryCancelSource.Dispose();
_queryCancelSource = new(); // create new token source for future tasks

}

// if non-empty string is returned, active layout is ready
Expand Down

0 comments on commit 20923f4

Please sign in to comment.