From 2f6e069bcd73436fd97ba4ab88aa72b467070737 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Date: Sun, 21 Nov 2021 13:17:30 +0100 Subject: [PATCH] Docked airlocks no longer depressurize the room when opened. (#5431) --- Content.Server/Doors/Components/ServerDoorComponent.cs | 9 ++++++--- Content.Server/Shuttles/EntitySystems/DockingSystem.cs | 7 +++++++ .../Entities/Structures/Doors/Airlocks/shuttle.yml | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Content.Server/Doors/Components/ServerDoorComponent.cs b/Content.Server/Doors/Components/ServerDoorComponent.cs index 42aebf1aa6..dda25a89f2 100644 --- a/Content.Server/Doors/Components/ServerDoorComponent.cs +++ b/Content.Server/Doors/Components/ServerDoorComponent.cs @@ -55,6 +55,9 @@ namespace Content.Server.Doors.Components [ViewVariables(VVAccess.ReadWrite)] public DamageSpecifier CrushDamage = default!; + [DataField("changeAirtight")] + public bool ChangeAirtight = true; + public override DoorState State { get => base.State; @@ -366,7 +369,7 @@ namespace Content.Server.Doors.Components occluder.Enabled = false; } - if (Owner.TryGetComponent(out AirtightComponent? airtight)) + if (ChangeAirtight && Owner.TryGetComponent(out AirtightComponent? airtight)) { EntitySystem.Get().SetAirblocked(airtight, false); } @@ -394,7 +397,7 @@ namespace Content.Server.Doors.Components { base.OnPartialOpen(); - if (Owner.TryGetComponent(out AirtightComponent? airtight)) + if (ChangeAirtight && Owner.TryGetComponent(out AirtightComponent? airtight)) { EntitySystem.Get().SetAirblocked(airtight, false); } @@ -537,7 +540,7 @@ namespace Content.Server.Doors.Components base.OnPartialClose(); // if safety is off, crushes people inside of the door, temporarily turning off collisions with them while doing so. - var becomeairtight = SafetyCheck() || !TryCrush(); + var becomeairtight = ChangeAirtight && (SafetyCheck() || !TryCrush()); if (becomeairtight && Owner.TryGetComponent(out AirtightComponent? airtight)) { diff --git a/Content.Server/Shuttles/EntitySystems/DockingSystem.cs b/Content.Server/Shuttles/EntitySystems/DockingSystem.cs index 8d2a1d4e63..6800f764cf 100644 --- a/Content.Server/Shuttles/EntitySystems/DockingSystem.cs +++ b/Content.Server/Shuttles/EntitySystems/DockingSystem.cs @@ -1,3 +1,5 @@ +using Content.Server.Atmos.Components; +using Content.Server.Atmos.EntitySystems; using Content.Server.Doors.Components; using Content.Server.Power.Components; using Content.Server.Shuttles.Components; @@ -21,6 +23,7 @@ namespace Content.Server.Shuttles.EntitySystems [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly SharedBroadphaseSystem _broadphaseSystem = default!; [Dependency] private readonly SharedJointSystem _jointSystem = default!; + [Dependency] private readonly AirtightSystem _airtightSystem = default!; private const string DockingFixture = "docking"; private const string DockingJoint = "docking"; @@ -346,11 +349,13 @@ namespace Content.Server.Shuttles.EntitySystems if (EntityManager.TryGetComponent(dockA.OwnerUid, out ServerDoorComponent? doorA)) { + doorA.ChangeAirtight = false; doorA.Open(); } if (EntityManager.TryGetComponent(dockB.OwnerUid, out ServerDoorComponent? doorB)) { + doorB.ChangeAirtight = false; doorB.Open(); } @@ -425,11 +430,13 @@ namespace Content.Server.Shuttles.EntitySystems if (EntityManager.TryGetComponent(dock.OwnerUid, out ServerDoorComponent? doorA)) { + doorA.ChangeAirtight = true; doorA.Close(); } if (EntityManager.TryGetComponent(dock.DockedWith.OwnerUid, out ServerDoorComponent? doorB)) { + doorB.ChangeAirtight = true; doorB.Close(); } diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/shuttle.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/shuttle.yml index 5ad7b08060..ce7b8b94dc 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/shuttle.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/shuttle.yml @@ -67,6 +67,8 @@ # type: WiresBoundUserInterface - type: Airtight fixVacuum: true + airBlockedDirection: + - South - type: Occluder - type: Damageable damageContainer: Inorganic