From bc972156bb0d918fca35d373f20f2c429f548ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Sun, 6 Sep 2020 17:34:45 +0200 Subject: [PATCH] Fix firelocks --- Content.Server/Atmos/TileAtmosphere.cs | 10 ++++++++-- Content.Shared/Atmos/AtmosDirection.cs | 5 +++++ .../Entities/Constructible/Doors/firelock.yml | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Content.Server/Atmos/TileAtmosphere.cs b/Content.Server/Atmos/TileAtmosphere.cs index 1a9d5b7e51..18927a772e 100644 --- a/Content.Server/Atmos/TileAtmosphere.cs +++ b/Content.Server/Atmos/TileAtmosphere.cs @@ -1159,9 +1159,15 @@ namespace Content.Server.Atmos public void UpdateAdjacent(AtmosDirection direction) { - if (!_gridAtmosphereComponent.IsAirBlocked(GridIndices.Offset(direction.ToDirection()))) + _adjacentTiles[direction.ToIndex()] = _gridAtmosphereComponent.GetTile(GridIndices.Offset(direction.ToDirection())); + + if (!_gridAtmosphereComponent.IsAirBlocked(GridIndices.Offset(direction.ToDirection()), direction.GetOpposite())) { - _adjacentTiles[direction.ToIndex()] = _gridAtmosphereComponent.GetTile(GridIndices.Offset(direction.ToDirection())); + _adjacentBits |= direction; + } + else + { + _adjacentBits &= ~direction; } } diff --git a/Content.Shared/Atmos/AtmosDirection.cs b/Content.Shared/Atmos/AtmosDirection.cs index 2b46faad18..c3991df998 100644 --- a/Content.Shared/Atmos/AtmosDirection.cs +++ b/Content.Shared/Atmos/AtmosDirection.cs @@ -87,6 +87,11 @@ namespace Content.Shared.Atmos { return direction | other; } + + public static AtmosDirection WithoutFlag(this AtmosDirection direction, AtmosDirection other) + { + return direction & ~other; + } } public sealed class AtmosDirectionFlags { } diff --git a/Resources/Prototypes/Entities/Constructible/Doors/firelock.yml b/Resources/Prototypes/Entities/Constructible/Doors/firelock.yml index ecfe8b2578..a4abf989ee 100644 --- a/Resources/Prototypes/Entities/Constructible/Doors/firelock.yml +++ b/Resources/Prototypes/Entities/Constructible/Doors/firelock.yml @@ -15,6 +15,8 @@ - state: closed_unlit shader: unshaded map: ["enum.DoorVisualLayers.BaseUnlit"] + - state: welded + map: ["enum.DoorVisualLayers.BaseWelded"] - state: bolted shader: unshaded map: ["enum.DoorVisualLayers.BaseBolted"]