diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs index a1a9e8844d..06cfe5cad6 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs @@ -1,4 +1,5 @@ using System.Linq; +using Content.Server.Atmos.Components; using Content.Server.Atmos.Piping.Components; using Content.Server.Atmos.Reactions; using Content.Server.NodeContainer.NodeGroups; @@ -297,7 +298,14 @@ public partial class AtmosphereSystem (EntityUid GridId, Vector2i Tile, ReactionResult Result = default, bool Handled = false); [ByRefEvent] private record struct IsTileAirBlockedMethodEvent - (EntityUid Grid, Vector2i Tile, AtmosDirection Direction = AtmosDirection.All, MapGridComponent? MapGridComponent = null, bool Result = false, bool Handled = false); + (EntityUid Grid, Vector2i Tile, AtmosDirection Direction = AtmosDirection.All, MapGridComponent? MapGridComponent = null, bool Result = false, bool Handled = false) + { + /// + /// True if one of the enabled blockers has . Note + /// that this does not actually check if all directions are blocked. + /// + public bool NoAir = false; + } [ByRefEvent] private record struct IsTileSpaceMethodEvent (EntityUid? Grid, EntityUid? Map, Vector2i Tile, MapGridComponent? MapGridComponent = null, bool Result = true, bool Handled = false); diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs index 24ba93f3f4..609f56a934 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs @@ -241,6 +241,7 @@ public sealed partial class AtmosphereSystem // We set the directions that are air-blocked so far, // as you could have a full obstruction with only 4 directional air blockers. directions |= obstructingComponent.AirBlockedDirection; + args.NoAir |= obstructingComponent.NoAirWhenFullyAirBlocked; if (directions.IsFlagSet(args.Direction)) { diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs index 0708ffe8ab..ede48828ed 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs @@ -83,22 +83,10 @@ namespace Content.Server.Atmos.EntitySystems tile.Air = GetTileMixture(null, mapUid, indices); tile.MolesArchived = tile.Air != null ? new float[Atmospherics.AdjustedNumberOfGases] : null; tile.Space = IsTileSpace(null, mapUid, indices, mapGridComp); - } else if (isAirBlocked) + } + else if (isAirBlocked) { - var nullAir = false; - - var enumerator = GetObstructingComponentsEnumerator(mapGridComp, indices); - - while (enumerator.MoveNext(out var airtight)) - { - if (!airtight.NoAirWhenFullyAirBlocked) - continue; - - nullAir = true; - break; - } - - if (nullAir) + if (airBlockedEv.NoAir) { tile.Air = null; tile.MolesArchived = null;