private void OnBeforeDoorClosed(EntityUid uid, AirlockComponent component, BeforeDoorClosedEvent args) { if (!component.CanChangeState()) { args.Cancel(); } }
protected override void OnBeforeDoorClosed(EntityUid uid, SharedAirlockComponent component, BeforeDoorClosedEvent args) { base.OnBeforeDoorClosed(uid, component, args); if (args.Cancelled) { return; } // only block based on bolts / power status when initially closing the door, not when its already // mid-transition. Particularly relevant for when the door was pried-closed with a crowbar, which bypasses // the initial power-check. if (TryComp(uid, out DoorComponent? door) && !door.Partial && !Comp <AirlockComponent>(uid).CanChangeState()) { args.Cancel(); } }