From 3fbe85416ea297ed5f09cd7e9b7e311c49840085 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Date: Fri, 11 Nov 2022 09:44:45 +0100 Subject: [PATCH] Rebuild excited groups if blocked airflow direction of tile has changed. (#12548) --- Content.Server/Atmos/EntitySystems/AirtightSystem.cs | 6 +----- .../Atmos/EntitySystems/AtmosphereSystem.Processing.cs | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs index 6301d2bf48..fd166164f9 100644 --- a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs @@ -31,7 +31,7 @@ namespace Content.Server.Atmos.EntitySystems var moveEvent = new MoveEvent(airtight.Owner, default, default, Angle.Zero, xform.LocalRotation, xform, false); OnAirtightRotated(uid, airtight, ref moveEvent); } - + UpdatePosition(airtight); } @@ -118,11 +118,7 @@ namespace Content.Server.Atmos.EntitySystems var query = EntityManager.GetEntityQuery(); _explosionSystem.UpdateAirtightMap(gridId, pos, query); // TODO make atmos system use query - _atmosphereSystem.UpdateAdjacent(gridUid, pos); _atmosphereSystem.InvalidateTile(gridUid, pos); - - if(fixVacuum) - _atmosphereSystem.FixTileVacuum(gridUid, pos); } private AtmosDirection Rotate(AtmosDirection myDirection, Angle myAngle) diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs index c6b7fc814b..59892beb28 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs @@ -67,9 +67,16 @@ namespace Content.Server.Atmos.EntitySystems GridIsTileAirBlocked(uid, atmosphere, ref airBlockedEv); var isAirBlocked = airBlockedEv.Result; + var oldBlocked = tile.BlockedAirflow; var updateAdjacentEv = new UpdateAdjacentMethodEvent(uid, indices, mapGridComp); GridUpdateAdjacent(uid, atmosphere, ref updateAdjacentEv); + // Blocked airflow changed, rebuild excited groups! + if (tile.Excited && tile.BlockedAirflow != oldBlocked) + { + RemoveActiveTile(atmosphere, tile); + } + // Call this instead of the grid method as the map has a say on whether the tile is space or not. if ((!mapGrid.TryGetTileRef(indices, out var t) || t.IsSpace(_tileDefinitionManager)) && !isAirBlocked) {