From c95c5e02c2fd2134904bbe229044bae9ac7e173f Mon Sep 17 00:00:00 2001 From: 20kdc Date: Sun, 17 Oct 2021 13:32:17 +0100 Subject: [PATCH] fixgridatmos blockers (#4911) * FixGridAtmos blocker * FixGridAtmos blockers in Saltern --- Content.Server/Atmos/Commands/FixGridAtmos.cs | 33 +- Resources/Maps/saltern.yml | 355 ++++++++++++++---- .../Entities/Markers/atmos_blocker.yml | 13 + Resources/Prototypes/tags.yml | 4 + 4 files changed, 336 insertions(+), 69 deletions(-) create mode 100644 Resources/Prototypes/Entities/Markers/atmos_blocker.yml diff --git a/Content.Server/Atmos/Commands/FixGridAtmos.cs b/Content.Server/Atmos/Commands/FixGridAtmos.cs index 0d49cc5fcb..c60d9ec0c3 100644 --- a/Content.Server/Atmos/Commands/FixGridAtmos.cs +++ b/Content.Server/Atmos/Commands/FixGridAtmos.cs @@ -1,7 +1,9 @@ using Content.Server.Administration; using Content.Server.Atmos.EntitySystems; +using Content.Server.Atmos.Components; using Content.Shared.Administration; using Content.Shared.Atmos; +using Content.Shared.Tag; using Robust.Shared.Console; using Robust.Shared.GameObjects; using Robust.Shared.IoC; @@ -24,6 +26,7 @@ namespace Content.Server.Atmos.Commands } var mapManager = IoCManager.Resolve(); + var entityManager = IoCManager.Resolve(); var atmosphereSystem = EntitySystem.Get(); var mixture = new GasMixture(Atmospherics.CellVolume) { Temperature = Atmospherics.T20C }; @@ -41,17 +44,41 @@ namespace Content.Server.Atmos.Commands var gridId = new GridId(i); - if (!mapManager.TryGetGrid(gridId, out _)) + if (!mapManager.TryGetGrid(gridId, out var mapGrid)) { shell.WriteError($"Grid \"{i}\" doesn't exist."); continue; } - foreach (var tile in atmosphereSystem.GetAllTileMixtures(gridId, true)) + if (!entityManager.TryGetComponent(mapGrid.GridEntityId, out GridAtmosphereComponent? gridAtmosphere)) { + shell.WriteError($"Grid \"{i}\" has no atmosphere component, try addatmos."); + continue; + } + + foreach (var (indices, tileMain) in gridAtmosphere.Tiles) + { + var tile = tileMain.Air; + if (tile == null) + continue; + tile.Clear(); - atmosphereSystem.Merge(tile, mixture); + var blocker = false; + foreach (var entUid in mapGrid.GetAnchoredEntities(indices)) + { + if (!entityManager.TryGetComponent(entUid, out TagComponent? tags)) + continue; + if (tags.HasTag("AtmosFixBlocking")) + { + blocker = true; + break; + } + } + if (!blocker) + atmosphereSystem.Merge(tile, mixture); tile.Temperature = mixture.Temperature; + + atmosphereSystem.InvalidateTile(gridAtmosphere, indices); } } } diff --git a/Resources/Maps/saltern.yml b/Resources/Maps/saltern.yml index 9830914ff3..9bb730bffe 100644 --- a/Resources/Maps/saltern.yml +++ b/Resources/Maps/saltern.yml @@ -13176,27 +13176,27 @@ entities: 32,18: 0 32,19: 0 32,20: 0 - 32,21: 0 - 32,22: 0 - 32,23: 0 + 32,21: 1 + 32,22: 1 + 32,23: 1 32,24: 0 33,16: 0 33,17: 0 33,18: 0 33,19: 0 33,20: 0 - 33,21: 0 - 33,22: 0 - 33,23: 0 + 33,21: 1 + 33,22: 1 + 33,23: 1 33,24: 0 34,16: 0 34,17: 0 34,18: 0 34,19: 0 34,20: 0 - 34,21: 0 - 34,22: 0 - 34,23: 0 + 34,21: 1 + 34,22: 1 + 34,23: 1 34,24: 0 35,16: 0 35,17: 0 @@ -13223,24 +13223,24 @@ entities: 37,18: 0 37,19: 0 37,20: 0 - 37,21: 0 - 37,22: 0 + 37,21: 1 + 37,22: 1 37,23: 0 38,16: 0 38,17: 0 38,18: 0 38,19: 0 38,20: 0 - 38,21: 0 - 38,22: 0 + 38,21: 1 + 38,22: 1 38,23: 0 39,16: 0 39,17: 0 39,18: 0 39,19: 0 39,20: 0 - 39,21: 0 - 39,22: 0 + 39,21: 1 + 39,22: 1 39,23: 0 40,16: 0 40,17: 0 @@ -13255,24 +13255,24 @@ entities: 41,18: 0 41,19: 0 41,20: 0 - 41,21: 0 - 41,22: 0 + 41,21: 1 + 41,22: 1 41,23: 0 42,16: 0 42,17: 0 42,18: 0 42,19: 0 42,20: 0 - 42,21: 0 - 42,22: 0 + 42,21: 1 + 42,22: 1 42,23: 0 43,16: 0 43,17: 0 43,18: 0 43,19: 0 43,20: 0 - 43,21: 0 - 43,22: 0 + 43,21: 1 + 43,22: 1 43,23: 0 44,16: 0 44,17: 0 @@ -13287,24 +13287,24 @@ entities: 45,18: 0 45,19: 0 45,20: 0 - 45,21: 0 - 45,22: 0 + 45,21: 1 + 45,22: 1 45,23: 0 46,16: 0 46,17: 0 46,18: 0 46,19: 0 46,20: 0 - 46,21: 0 - 46,22: 0 + 46,21: 1 + 46,22: 1 46,23: 0 47,16: 0 47,17: 0 47,18: 0 47,19: 0 47,20: 0 - 47,21: 0 - 47,22: 0 + 47,21: 1 + 47,22: 1 47,23: 0 48,16: 0 48,17: 0 @@ -13320,19 +13320,19 @@ entities: 49,19: 0 49,20: 0 50,16: 0 - 50,17: 0 - 50,18: 0 - 50,19: 0 + 50,17: 1 + 50,18: 1 + 50,19: 1 50,20: 0 51,16: 0 - 51,17: 0 - 51,18: 0 - 51,19: 0 + 51,17: 1 + 51,18: 1 + 51,19: 1 51,20: 0 52,16: 0 - 52,17: 0 - 52,18: 0 - 52,19: 0 + 52,17: 1 + 52,18: 1 + 52,19: 1 52,20: 0 53,16: 0 53,17: 0 @@ -13351,6 +13351,17 @@ entities: - 0 - 0 - 0 + - volume: 2500 + temperature: 293.15 + moles: + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 type: GridAtmosphere - angularDamping: 0.1 fixedRotation: False @@ -22084,8 +22095,6 @@ entities: - pos: -37.5,26.5 parent: 853 type: Transform - - supplyRate: 1268 - type: PowerSupplier - uid: 1713 type: WallReinforced components: @@ -28339,8 +28348,6 @@ entities: - pos: -37.5,25.5 parent: 853 type: Transform - - supplyRate: 1269 - type: PowerSupplier - uid: 2560 type: CableApcExtension components: @@ -52077,8 +52084,6 @@ entities: - pos: -37.5,27.5 parent: 853 type: Transform - - supplyRate: 1268 - type: PowerSupplier - uid: 5044 type: SolarPanel components: @@ -53282,48 +53287,36 @@ entities: - pos: -35.5,23.5 parent: 853 type: Transform - - supplyRate: 1268 - type: PowerSupplier - uid: 5201 type: SolarPanel components: - pos: -35.5,22.5 parent: 853 type: Transform - - supplyRate: 1269 - type: PowerSupplier - uid: 5202 type: SolarPanel components: - pos: -35.5,21.5 parent: 853 type: Transform - - supplyRate: 1268 - type: PowerSupplier - uid: 5203 type: SolarPanel components: - pos: -37.5,23.5 parent: 853 type: Transform - - supplyRate: 1269 - type: PowerSupplier - uid: 5204 type: SolarPanel components: - pos: -37.5,22.5 parent: 853 type: Transform - - supplyRate: 1269 - type: PowerSupplier - uid: 5205 type: SolarPanel components: - pos: -37.5,21.5 parent: 853 type: Transform - - supplyRate: 1269 - type: PowerSupplier - uid: 5206 type: WallReinforced components: @@ -53986,19 +53979,23 @@ entities: - pos: 20.5,-27.5 parent: 853 type: Transform + - supplyRate: 119 + type: PowerSupplier - uid: 5296 type: SolarPanel components: - pos: 20.5,-28.5 parent: 853 type: Transform + - supplyRate: 120 + type: PowerSupplier - uid: 5297 type: SolarPanel components: - pos: 20.5,-29.5 parent: 853 type: Transform - - supplyRate: 1269 + - supplyRate: 120 type: PowerSupplier - uid: 5298 type: SolarPanel @@ -54006,7 +54003,7 @@ entities: - pos: 20.5,-30.5 parent: 853 type: Transform - - supplyRate: 1269 + - supplyRate: 120 type: PowerSupplier - uid: 5299 type: SolarPanel @@ -54014,13 +54011,15 @@ entities: - pos: 22.5,-27.5 parent: 853 type: Transform + - supplyRate: 121 + type: PowerSupplier - uid: 5300 type: SolarPanel components: - pos: 22.5,-28.5 parent: 853 type: Transform - - supplyRate: 1268 + - supplyRate: 120 type: PowerSupplier - uid: 5301 type: SolarPanel @@ -54028,7 +54027,7 @@ entities: - pos: 22.5,-29.5 parent: 853 type: Transform - - supplyRate: 1269 + - supplyRate: 120 type: PowerSupplier - uid: 5302 type: SolarPanel @@ -54036,7 +54035,7 @@ entities: - pos: 22.5,-30.5 parent: 853 type: Transform - - supplyRate: 1268 + - supplyRate: 121 type: PowerSupplier - uid: 5303 type: SolarPanel @@ -54044,13 +54043,15 @@ entities: - pos: 24.5,-27.5 parent: 853 type: Transform + - supplyRate: 120 + type: PowerSupplier - uid: 5304 type: SolarPanel components: - pos: 24.5,-28.5 parent: 853 type: Transform - - supplyRate: 1269 + - supplyRate: 120 type: PowerSupplier - uid: 5305 type: SolarPanel @@ -54058,7 +54059,7 @@ entities: - pos: 24.5,-29.5 parent: 853 type: Transform - - supplyRate: 1269 + - supplyRate: 121 type: PowerSupplier - uid: 5306 type: SolarPanel @@ -54066,7 +54067,7 @@ entities: - pos: 24.5,-30.5 parent: 853 type: Transform - - supplyRate: 1269 + - supplyRate: 121 type: PowerSupplier - uid: 5307 type: SolarPanel @@ -54080,7 +54081,7 @@ entities: - pos: 26.5,-28.5 parent: 853 type: Transform - - supplyRate: 1269 + - supplyRate: 122 type: PowerSupplier - uid: 5309 type: SolarPanel @@ -54088,15 +54089,13 @@ entities: - pos: 26.5,-29.5 parent: 853 type: Transform - - supplyRate: 1268 - type: PowerSupplier - uid: 5310 type: SolarPanel components: - pos: 26.5,-30.5 parent: 853 type: Transform - - supplyRate: 1269 + - supplyRate: 120 type: PowerSupplier - uid: 5311 type: SolarPanel @@ -54104,24 +54103,32 @@ entities: - pos: 18.5,-27.5 parent: 853 type: Transform + - supplyRate: 119 + type: PowerSupplier - uid: 5312 type: SolarPanel components: - pos: 18.5,-28.5 parent: 853 type: Transform + - supplyRate: 120 + type: PowerSupplier - uid: 5313 type: SolarPanel components: - pos: 18.5,-29.5 parent: 853 type: Transform + - supplyRate: 120 + type: PowerSupplier - uid: 5314 type: SolarPanel components: - pos: 18.5,-30.5 parent: 853 type: Transform + - supplyRate: 120 + type: PowerSupplier - uid: 5315 type: CableApcExtension components: @@ -69306,4 +69313,220 @@ entities: - pos: 36.5,13.5 parent: 853 type: Transform +- uid: 6642 + type: AtmosFixBlockerMarker + components: + - pos: 32.5,23.5 + parent: 853 + type: Transform +- uid: 6643 + type: AtmosFixBlockerMarker + components: + - pos: 32.5,22.5 + parent: 853 + type: Transform +- uid: 6644 + type: AtmosFixBlockerMarker + components: + - pos: 32.5,21.5 + parent: 853 + type: Transform +- uid: 6645 + type: AtmosFixBlockerMarker + components: + - pos: 33.5,23.5 + parent: 853 + type: Transform +- uid: 6646 + type: AtmosFixBlockerMarker + components: + - pos: 33.5,22.5 + parent: 853 + type: Transform +- uid: 6647 + type: AtmosFixBlockerMarker + components: + - pos: 33.5,21.5 + parent: 853 + type: Transform +- uid: 6648 + type: AtmosFixBlockerMarker + components: + - pos: 34.5,23.5 + parent: 853 + type: Transform +- uid: 6649 + type: AtmosFixBlockerMarker + components: + - pos: 34.5,22.5 + parent: 853 + type: Transform +- uid: 6650 + type: AtmosFixBlockerMarker + components: + - pos: 34.5,21.5 + parent: 853 + type: Transform +- uid: 6651 + type: AtmosFixBlockerMarker + components: + - pos: 37.5,22.5 + parent: 853 + type: Transform +- uid: 6652 + type: AtmosFixBlockerMarker + components: + - pos: 37.5,21.5 + parent: 853 + type: Transform +- uid: 6653 + type: AtmosFixBlockerMarker + components: + - pos: 38.5,22.5 + parent: 853 + type: Transform +- uid: 6654 + type: AtmosFixBlockerMarker + components: + - pos: 38.5,21.5 + parent: 853 + type: Transform +- uid: 6655 + type: AtmosFixBlockerMarker + components: + - pos: 39.5,22.5 + parent: 853 + type: Transform +- uid: 6656 + type: AtmosFixBlockerMarker + components: + - pos: 39.5,21.5 + parent: 853 + type: Transform +- uid: 6657 + type: AtmosFixBlockerMarker + components: + - pos: 41.5,22.5 + parent: 853 + type: Transform +- uid: 6658 + type: AtmosFixBlockerMarker + components: + - pos: 41.5,21.5 + parent: 853 + type: Transform +- uid: 6659 + type: AtmosFixBlockerMarker + components: + - pos: 42.5,22.5 + parent: 853 + type: Transform +- uid: 6660 + type: AtmosFixBlockerMarker + components: + - pos: 42.5,21.5 + parent: 853 + type: Transform +- uid: 6661 + type: AtmosFixBlockerMarker + components: + - pos: 43.5,22.5 + parent: 853 + type: Transform +- uid: 6662 + type: AtmosFixBlockerMarker + components: + - pos: 43.5,21.5 + parent: 853 + type: Transform +- uid: 6663 + type: AtmosFixBlockerMarker + components: + - pos: 45.5,22.5 + parent: 853 + type: Transform +- uid: 6664 + type: AtmosFixBlockerMarker + components: + - pos: 45.5,21.5 + parent: 853 + type: Transform +- uid: 6665 + type: AtmosFixBlockerMarker + components: + - pos: 46.5,22.5 + parent: 853 + type: Transform +- uid: 6666 + type: AtmosFixBlockerMarker + components: + - pos: 46.5,21.5 + parent: 853 + type: Transform +- uid: 6667 + type: AtmosFixBlockerMarker + components: + - pos: 47.5,22.5 + parent: 853 + type: Transform +- uid: 6668 + type: AtmosFixBlockerMarker + components: + - pos: 47.5,21.5 + parent: 853 + type: Transform +- uid: 6669 + type: AtmosFixBlockerMarker + components: + - pos: 50.5,19.5 + parent: 853 + type: Transform +- uid: 6670 + type: AtmosFixBlockerMarker + components: + - pos: 50.5,18.5 + parent: 853 + type: Transform +- uid: 6671 + type: AtmosFixBlockerMarker + components: + - pos: 50.5,17.5 + parent: 853 + type: Transform +- uid: 6672 + type: AtmosFixBlockerMarker + components: + - pos: 51.5,19.5 + parent: 853 + type: Transform +- uid: 6673 + type: AtmosFixBlockerMarker + components: + - pos: 51.5,18.5 + parent: 853 + type: Transform +- uid: 6674 + type: AtmosFixBlockerMarker + components: + - pos: 51.5,17.5 + parent: 853 + type: Transform +- uid: 6675 + type: AtmosFixBlockerMarker + components: + - pos: 52.5,19.5 + parent: 853 + type: Transform +- uid: 6676 + type: AtmosFixBlockerMarker + components: + - pos: 52.5,18.5 + parent: 853 + type: Transform +- uid: 6677 + type: AtmosFixBlockerMarker + components: + - pos: 52.5,17.5 + parent: 853 + type: Transform ... diff --git a/Resources/Prototypes/Entities/Markers/atmos_blocker.yml b/Resources/Prototypes/Entities/Markers/atmos_blocker.yml new file mode 100644 index 0000000000..35ce1c7632 --- /dev/null +++ b/Resources/Prototypes/Entities/Markers/atmos_blocker.yml @@ -0,0 +1,13 @@ +- type: entity + name: Atmos Fix Blocker Marker + id: AtmosFixBlockerMarker + parent: MarkerBase + components: + - type: Sprite + layers: + - state: red + - texture: Objects/Specific/Atmos/gasanalyzer.rsi/icon.png + - type: Tag + tags: + - AtmosFixBlocking + diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 663782878c..af17b818da 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -213,3 +213,7 @@ - type: Tag id: HideContextMenu + +- type: Tag + id: AtmosFixBlocking +