]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Prevent possible future game state bugs (#14323)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Wed, 1 Mar 2023 15:26:37 +0000 (04:26 +1300)
committerGitHub <noreply@github.com>
Wed, 1 Mar 2023 15:26:37 +0000 (09:26 -0600)
Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs
Content.Shared/Decals/SharedDecalSystem.cs

index 70b145512d4551cfd711dff2658de3c15bb1a328..a4220a0271244e7ff31a3f1ab9c15a2abe909d21 100644 (file)
@@ -26,7 +26,7 @@ using Robust.Shared.Utility;
 namespace Content.Server.Atmos.EntitySystems
 {
     [UsedImplicitly]
-    internal sealed class GasTileOverlaySystem : SharedGasTileOverlaySystem
+    public sealed class GasTileOverlaySystem : SharedGasTileOverlaySystem
     {
         [Robust.Shared.IoC.Dependency] private readonly IGameTiming _gameTiming = default!;
         [Robust.Shared.IoC.Dependency] private readonly IPlayerManager _playerManager = default!;
@@ -65,6 +65,14 @@ namespace Content.Server.Atmos.EntitySystems
 
             SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
             SubscribeLocalEvent<GasTileOverlayComponent, ComponentGetState>(OnGetState);
+            SubscribeLocalEvent<GasTileOverlayComponent, ComponentStartup>(OnStartup);
+        }
+
+        private void OnStartup(EntityUid uid, GasTileOverlayComponent component, ComponentStartup args)
+        {
+            // This **shouldn't** be required, but just in case we ever get entity prototypes that have gas overlays, we
+            // need to ensure that we send an initial full state to players.
+            Dirty(component);
         }
 
         public override void Shutdown()
index 7043a7b39643c8c3a8d558bd3e7a70608b77a1cd..29f628c7ae0ed9adaa749507341ab37a2bfc2711 100644 (file)
@@ -38,6 +38,10 @@ namespace Content.Shared.Decals
                     component.DecalIndex[decalUid] = indices;
                 }
             }
+
+            // This **shouldn't** be required, but just in case we ever get entity prototypes that have decal grids, we
+            // need to ensure that we send an initial full state to players.
+            Dirty(component);
         }
 
         protected Dictionary<Vector2i, DecalChunk>? ChunkCollection(EntityUid gridEuid, DecalGridComponent? comp = null)