Fix firelock lights for hot / pressurized rooms (#15892)

This commit is contained in:
Tom Leys
2023-05-06 17:54:36 +12:00
committed by GitHub
parent eaa83ae113
commit 79eeefd813
9 changed files with 32 additions and 12 deletions

View File

@@ -1,44 +0,0 @@
using Content.Server.Atmos.Monitor.Components;
using Content.Shared.Doors.Components;
namespace Content.Server.Doors.Components
{
/// <summary>
/// Companion component to <see cref="DoorComponent"/> that handles firelock-specific behavior, including
/// auto-closing on depressurization, air/fire alarm interactions, and preventing normal door functions when
/// retaining pressure..
/// </summary>
[RegisterComponent]
public sealed class FirelockComponent : Component
{
/// <summary>
/// Pry time modifier to be used when the firelock is currently closed due to fire or pressure.
/// </summary>
/// <returns></returns>
[DataField("lockedPryTimeModifier"), ViewVariables(VVAccess.ReadWrite)]
public float LockedPryTimeModifier = 1.5f;
[DataField("autocloseDelay")] public TimeSpan AutocloseDelay = TimeSpan.FromSeconds(3f);
/// <summary>
/// Maximum pressure difference before the firelock will refuse to open, in kPa.
/// </summary>
[DataField("pressureThreshold"), ViewVariables(VVAccess.ReadWrite)]
public float PressureThreshold = 20;
/// <summary>
/// Maximum temperature difference before the firelock will refuse to open, in k.
/// </summary>
[DataField("temperatureThreshold"), ViewVariables(VVAccess.ReadWrite)]
public float TemperatureThreshold = 330;
// this used to check for hot-spots, but because accessing that data is a a mess this now just checks
// temperature. This does mean a cold room will trigger hot-air pop-ups
/// <summary>
/// If true, and if this door has an <see cref="AtmosAlarmableComponent"/>, then it will only auto-close if the
/// alarm is set to danger.
/// </summary>
[DataField("alarmAutoClose"), ViewVariables(VVAccess.ReadWrite)]
public bool AlarmAutoClose = true;
}
}

View File

@@ -1,7 +1,6 @@
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Monitor.Systems;
using Content.Server.Doors.Components;
using Content.Server.Popups;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
@@ -161,13 +160,13 @@ namespace Content.Server.Doors.Systems
{
var ev = new BeforeDoorAutoCloseEvent();
RaiseLocalEvent(uid, ev);
UpdateVisuals(uid, component, args);
if (ev.Cancelled)
{
return;
}
_doorSystem.SetNextStateChange(uid, component.AutocloseDelay);
UpdateVisuals(uid, component, args);
}
private void OnBeforeDoorAutoclose(EntityUid uid, FirelockComponent component, BeforeDoorAutoCloseEvent args)

View File

@@ -1,4 +1,3 @@
using Content.Server.Doors.Components;
using Content.Server.Wires;
using Content.Shared.Doors;
using Content.Shared.Doors.Components;
@@ -11,7 +10,7 @@ public sealed class DoorSafetyWireAction : ComponentWireAction<AirlockComponent>
{
public override Color Color { get; set; } = Color.Red;
public override string Name { get; set; } = "wire-name-door-safety";
[DataField("timeout")]
private int _timeout = 30;

View File

@@ -1,4 +1,3 @@
using Content.Server.Doors.Components;
using Content.Server.Wires;
using Content.Shared.Doors;
using Content.Shared.Doors.Components;
@@ -11,7 +10,7 @@ public sealed class DoorTimingWireAction : ComponentWireAction<AirlockComponent>
{
public override Color Color { get; set; } = Color.Orange;
public override string Name { get; set; } = "wire-name-door-timer";
[DataField("timeout")]
private int _timeout = 30;