From 21a5bce90daf5eba2583c97b11f6f1ff9d519805 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sun, 30 Jan 2022 20:30:24 +1300 Subject: [PATCH] fix airlocks/shutters, again (#6386) --- Content.Server/Doors/Systems/DoorSystem.cs | 12 ++++++++++++ Content.Shared/Doors/Systems/SharedDoorSystem.cs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index db0f0502d4..32398d3887 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -42,6 +42,18 @@ public sealed class DoorSystem : SharedDoorSystem SubscribeLocalEvent(OnWeldCancelled); } + protected override void OnInit(EntityUid uid, DoorComponent door, ComponentInit args) + { + base.OnInit(uid, door, args); + + if (door.State == DoorState.Open + && door.ChangeAirtight + && TryComp(uid, out AirtightComponent? airtight)) + { + _airtightSystem.SetAirblocked(airtight, false); + } + } + // TODO AUDIO PREDICT Figure out a better way to handle sound and prediction. For now, this works well enough? // // Currently a client will predict when a door is going to close automatically. So any client in PVS range can just diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index fb9f95decc..ea720a741b 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -59,7 +59,7 @@ public abstract class SharedDoorSystem : EntitySystem SubscribeLocalEvent(PreventCollision); } - private void OnInit(EntityUid uid, DoorComponent door, ComponentInit args) + protected virtual void OnInit(EntityUid uid, DoorComponent door, ComponentInit args) { // if the door state is not standard (i.e., door starts open), make sure collision & occlusion are properly set. if (door.State == DoorState.Open)