From e5b4b70e4d11557699a9fb7bd518e2cfab7ab9c9 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:23:32 +1300 Subject: [PATCH] Fix decals (#13491) Fixes https://github.com/space-wizards/space-station-14/issues/13479 --- Content.Shared/Decals/SharedDecalSystem.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Decals/SharedDecalSystem.cs b/Content.Shared/Decals/SharedDecalSystem.cs index 01a93044a9..5c1c86a43e 100644 --- a/Content.Shared/Decals/SharedDecalSystem.cs +++ b/Content.Shared/Decals/SharedDecalSystem.cs @@ -25,6 +25,7 @@ namespace Content.Shared.Decals SubscribeLocalEvent(OnGridInitialize); SubscribeLocalEvent(OnCompAdd); + SubscribeLocalEvent(OnCompStartup); SubscribeLocalEvent(OnCompRemove); } @@ -40,7 +41,12 @@ namespace Content.Shared.Decals protected virtual void OnCompAdd(EntityUid uid, DecalGridComponent component, ComponentAdd args) { - var index = ChunkIndex[uid] = new(); + ChunkIndex[uid] = new(); + } + + private void OnCompStartup(EntityUid uid, DecalGridComponent component, ComponentStartup args) + { + var index = ChunkIndex[uid]; foreach (var (indices, decals) in component.ChunkCollection.ChunkCollection) { foreach (var decalUid in decals.Decals.Keys)