]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Don't add ImplicitRoof to grids with roof component (#38551)
authormtrs163 <153596133+mtrs163@users.noreply.github.com>
Tue, 14 Oct 2025 23:05:29 +0000 (06:05 +0700)
committerGitHub <noreply@github.com>
Tue, 14 Oct 2025 23:05:29 +0000 (23:05 +0000)
* Don't add implicitroof to grids with roof component

* changes 1

Content.Server/Shuttles/Systems/ShuttleSystem.cs
Content.Shared/Light/Components/ImplicitRoofComponent.cs
Content.Shared/Light/Components/RoofComponent.cs

index cea7fbfc091f1ab136a43aac86f28d959117408b..e96ceffd16a06305cae7337f75c81ef199b31f47 100644 (file)
@@ -104,7 +104,12 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
             return;
 
         EnsureComp<ShuttleComponent>(ev.EntityUid);
-        EnsureComp<ImplicitRoofComponent>(ev.EntityUid);
+
+        // This and RoofComponent should be mutually exclusive, so ImplicitRoof should be removed if the grid has RoofComponent
+        if (HasComp<RoofComponent>(ev.EntityUid))
+            RemComp<ImplicitRoofComponent>(ev.EntityUid);
+        else
+            EnsureComp<ImplicitRoofComponent>(ev.EntityUid);
     }
 
     private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
index b457bac3e4c569f9a8305a882dec1ed80394ac43..08afe883b72c938afece8b9024b27cd504d08f9a 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.GameStates;
 namespace Content.Shared.Light.Components;
 
 /// <summary>
-/// Assumes the entire attached grid is rooved.
+/// Assumes the entire attached grid is rooved. This component will get removed if the grid has RoofComponent.
 /// </summary>
 [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
 public sealed partial class ImplicitRoofComponent : Component
index 47de333af0af993f6efac03374287d2f803ac275..4457a952ebfd7bd4d903ee71dcd537e676c7521f 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.GameStates;
 namespace Content.Shared.Light.Components;
 
 /// <summary>
-/// Will draw shadows over tiles flagged as roof tiles on the attached grid.
+/// Will draw shadows over tiles flagged as roof tiles on the attached grid. ImplicitRoofComponent will get removed if the grid has this component.
 /// </summary>
 [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
 public sealed partial class RoofComponent : Component