Bandaid pathpoly neighbors for now (#12337)
This commit is contained in:
@@ -89,13 +89,13 @@ public sealed partial class PathfindingSystem
|
||||
// TODO: Often we invalidate the entire chunk when it might be something as simple as an airlock change
|
||||
// Would be better to handle that though this was safer and max it's taking is like 1-2ms every half-second.
|
||||
var dirt = new GridPathfindingChunk[comp.DirtyChunks.Count];
|
||||
var i = 0;
|
||||
var idx = 0;
|
||||
|
||||
foreach (var origin in comp.DirtyChunks)
|
||||
{
|
||||
var chunk = GetChunk(origin, comp.Owner, comp);
|
||||
dirt[i] = chunk;
|
||||
i++;
|
||||
dirt[idx] = chunk;
|
||||
idx++;
|
||||
}
|
||||
|
||||
// We force clear portals in a single-threaded context to be safe
|
||||
@@ -119,7 +119,7 @@ public sealed partial class PathfindingSystem
|
||||
// This is for map <> grid pathfinding
|
||||
|
||||
// Without parallel this is roughly 3x slower on my desktop.
|
||||
Parallel.For(0, dirt.Length, i =>
|
||||
for (var i = 0; i < dirt.Length; i++)
|
||||
{
|
||||
// Doing the queries per task seems faster.
|
||||
var accessQuery = GetEntityQuery<AccessReaderComponent>();
|
||||
@@ -129,7 +129,7 @@ public sealed partial class PathfindingSystem
|
||||
var physicsQuery = GetEntityQuery<PhysicsComponent>();
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
BuildBreadcrumbs(dirt[i], mapGridComp.Grid, accessQuery, destructibleQuery, doorQuery, fixturesQuery, physicsQuery, xformQuery);
|
||||
});
|
||||
}
|
||||
|
||||
const int Division = 4;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user