Fix NavMap exception (#23636)

This commit is contained in:
Leon Friedrich 2024-01-06 16:06:52 -05:00 committed by GitHub
parent eb46918d7e
commit 4ddb3db1ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)