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)
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
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