Fix NavMap exception (#23636)

(cherry picked from commit 4ddb3db1ec)
This commit is contained in:
Leon Friedrich
2024-01-26 22:03:44 +01:00
committed by Debug
parent 96e6f97054
commit 3e3a0403f2
+4 -1
View File
@@ -154,6 +154,9 @@ public sealed class NavMapSystem : SharedNavMapSystem
private void OnNavMapSplit(ref GridSplitEvent args)
{
if (!TryComp(args.Grid, out NavMapComponent? comp))
return;
var gridQuery = GetEntityQuery<MapGridComponent>();
foreach (var grid in args.NewGrids)
@@ -162,7 +165,7 @@ public sealed class NavMapSystem : SharedNavMapSystem
RefreshGrid(newComp, gridQuery.GetComponent(grid));
}
RefreshGrid(Comp<NavMapComponent>(args.Grid), gridQuery.GetComponent(args.Grid));
RefreshGrid(comp, gridQuery.GetComponent(args.Grid));
}
private void RefreshGrid(NavMapComponent component, MapGridComponent grid)