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)