fix airlocks/shutters, again (#6386)

This commit is contained in:
Leon Friedrich
2022-01-30 20:30:24 +13:00
committed by GitHub
parent 790a204980
commit 21a5bce90d
2 changed files with 13 additions and 1 deletions

View File

@@ -42,6 +42,18 @@ public sealed class DoorSystem : SharedDoorSystem
SubscribeLocalEvent<DoorComponent, WeldCancelledEvent>(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

View File

@@ -59,7 +59,7 @@ public abstract class SharedDoorSystem : EntitySystem
SubscribeLocalEvent<DoorComponent, PreventCollideEvent>(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)