From a46f6f3f85b60b7b8e8a9e6aae327c9c1a0dd2bf Mon Sep 17 00:00:00 2001
From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Date: Wed, 10 Jan 2024 23:44:09 +1100
Subject: [PATCH] Fix ruins being added to station grid (#23865)
---
.../Shuttles/Components/GridSpawnComponent.cs | 5 +++++
.../Shuttles/Systems/ShuttleSystem.GridFill.cs | 16 ++++++++++------
Resources/Prototypes/Entities/Stations/base.yml | 2 ++
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/Content.Server/Shuttles/Components/GridSpawnComponent.cs b/Content.Server/Shuttles/Components/GridSpawnComponent.cs
index 86874541df..95338927ca 100644
--- a/Content.Server/Shuttles/Components/GridSpawnComponent.cs
+++ b/Content.Server/Shuttles/Components/GridSpawnComponent.cs
@@ -33,6 +33,11 @@ public record struct GridSpawnGroup
///
public bool NameGrid = false;
+ ///
+ /// Should we add this to the station's grids (if possible / relevant).
+ ///
+ public bool StationGrid = true;
+
public GridSpawnGroup()
{
}
diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs
index 5452a0bb9d..5276046a27 100644
--- a/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs
+++ b/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs
@@ -88,6 +88,15 @@ public sealed partial class ShuttleSystem
if (_loader.TryLoad(mapId, path.ToString(), out var ent) && ent.Count == 1)
{
+ if (TryComp(ent[0], out var shuttle))
+ {
+ TryFTLProximity(ent[0], shuttle, targetGrid.Value);
+ }
+ else
+ {
+ valid = false;
+ }
+
if (group.Hide)
{
var iffComp = EnsureComp(ent[0]);
@@ -95,15 +104,10 @@ public sealed partial class ShuttleSystem
Dirty(ent[0], iffComp);
}
- if (TryComp(ent[0], out var shuttle))
+ if (group.StationGrid)
{
- TryFTLProximity(ent[0], shuttle, targetGrid.Value);
_station.AddGridToStation(uid, ent[0]);
}
- else
- {
- valid = false;
- }
if (group.NameGrid)
{
diff --git a/Resources/Prototypes/Entities/Stations/base.yml b/Resources/Prototypes/Entities/Stations/base.yml
index 4871ae50f1..8c78775ba5 100644
--- a/Resources/Prototypes/Entities/Stations/base.yml
+++ b/Resources/Prototypes/Entities/Stations/base.yml
@@ -56,6 +56,7 @@
nameGrid: true
minCount: 2
maxCount: 2
+ stationGrid: false
paths:
- /Maps/Ruins/derelict.yml
- /Maps/Ruins/djstation.yml
@@ -83,6 +84,7 @@
nameGrid: true
minCount: 2
maxCount: 2
+ stationGrid: false
paths:
- /Maps/Ruins/derelict.yml
- /Maps/Ruins/djstation.yml