Fix NavMap exception (#23636)

(cherry picked from commit 4ddb3db1ecd300742992d2ebe445e085287a9ecf)
This commit is contained in:
Leon Friedrich 2024-01-06 16:06:52 -05:00 committed by Debug
parent 96e6f97054
commit 3e3a0403f2
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
1 changed files with 4 additions and 1 deletions

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)