Clear path on exception (#12335)
Should hopefully avoid it spamming in future.
This commit is contained in:
@@ -93,16 +93,24 @@ namespace Content.Server.NPC.Pathfinding
|
|||||||
|
|
||||||
var request = _pathRequests[i];
|
var request = _pathRequests[i];
|
||||||
|
|
||||||
switch (request)
|
try
|
||||||
{
|
{
|
||||||
case AStarPathRequest astar:
|
switch (request)
|
||||||
results[i] = UpdateAStarPath(astar);
|
{
|
||||||
break;
|
case AStarPathRequest astar:
|
||||||
case BFSPathRequest bfs:
|
results[i] = UpdateAStarPath(astar);
|
||||||
results[i] = UpdateBFSPath(_random, bfs);
|
break;
|
||||||
break;
|
case BFSPathRequest bfs:
|
||||||
default:
|
results[i] = UpdateBFSPath(_random, bfs);
|
||||||
throw new NotImplementedException();
|
break;
|
||||||
|
default:
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
results[i] = PathResult.NoPath;
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -123,6 +131,7 @@ namespace Content.Server.NPC.Pathfinding
|
|||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
case PathResult.Continuing:
|
case PathResult.Continuing:
|
||||||
|
DebugTools.Assert(path.Frontier.Count > 0);
|
||||||
break;
|
break;
|
||||||
case PathResult.PartialPath:
|
case PathResult.PartialPath:
|
||||||
case PathResult.Path:
|
case PathResult.Path:
|
||||||
|
|||||||
Reference in New Issue
Block a user