Clear path on exception (#12335)

Should hopefully avoid it spamming in future.
This commit is contained in:
metalgearsloth
2022-11-02 12:12:50 +11:00
committed by GitHub
parent 4a4de188da
commit 4cb96dba6d

View File

@@ -93,6 +93,8 @@ namespace Content.Server.NPC.Pathfinding
var request = _pathRequests[i];
try
{
switch (request)
{
case AStarPathRequest astar:
@@ -104,6 +106,12 @@ namespace Content.Server.NPC.Pathfinding
default:
throw new NotImplementedException();
}
}
catch (Exception)
{
results[i] = PathResult.NoPath;
throw;
}
});
var offset = 0;
@@ -123,6 +131,7 @@ namespace Content.Server.NPC.Pathfinding
switch (result)
{
case PathResult.Continuing:
DebugTools.Assert(path.Frontier.Count > 0);
break;
case PathResult.PartialPath:
case PathResult.Path: