From 6a6d40c83f5442135b5594c17c8a4bb640a73315 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 13 Apr 2023 21:13:24 +1000 Subject: [PATCH] Station map init (#15374) --- Content.Server/Pinpointer/NavMapSystem.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Content.Server/Pinpointer/NavMapSystem.cs b/Content.Server/Pinpointer/NavMapSystem.cs index 81de3a4368..dae3c1ca66 100644 --- a/Content.Server/Pinpointer/NavMapSystem.cs +++ b/Content.Server/Pinpointer/NavMapSystem.cs @@ -1,3 +1,5 @@ +using Content.Server.Station.Components; +using Content.Server.Station.Systems; using Content.Shared.Pinpointer; using Content.Shared.Tag; using Robust.Shared.GameStates; @@ -21,6 +23,15 @@ public sealed class NavMapSystem : SharedNavMapSystem SubscribeLocalEvent(OnReAnchor); SubscribeLocalEvent(OnGetState); SubscribeLocalEvent(OnNavMapSplit); + SubscribeLocalEvent(OnStationInit); + } + + private void OnStationInit(StationGridAddedEvent ev) + { + var comp = EnsureComp(ev.GridId); + var physicsQuery = GetEntityQuery(); + var tagQuery = GetEntityQuery(); + RefreshGrid(comp, Comp(ev.GridId), physicsQuery, tagQuery); } private void OnNavMapSplit(EntityUid uid, NavMapComponent component, ref GridSplitEvent args) @@ -51,6 +62,7 @@ public sealed class NavMapSystem : SharedNavMapSystem if (!component.Chunks.TryGetValue(chunkOrigin, out var chunk)) { chunk = new NavMapChunk(chunkOrigin); + component.Chunks[chunkOrigin] = chunk; } RefreshTile(grid, component, chunk, tile.Value.GridIndices, physicsQuery, tagQuery); -- 2.51.2