Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix firelock prediction issues with periodic pulses of closing lights #28227

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions Content.Server/Doors/Systems/FirelockSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public override void Initialize()
{
base.Initialize();


SubscribeLocalEvent<FirelockComponent, BeforeDoorAutoCloseEvent>(OnBeforeDoorAutoclose);
SubscribeLocalEvent<FirelockComponent, AtmosAlarmEvent>(OnAtmosAlarm);

SubscribeLocalEvent<FirelockComponent, PowerChangedEvent>(PowerChanged);
Expand Down Expand Up @@ -80,19 +78,6 @@ public override void Update(float frameTime)
}
}

private void OnBeforeDoorAutoclose(EntityUid uid, FirelockComponent component, BeforeDoorAutoCloseEvent args)
{
if (!this.IsPowered(uid, EntityManager))
args.Cancel();

// Make firelocks autoclose, but only if the last alarm type it
// remembers was a danger. This is to prevent people from
// flooding hallways with endless bad air/fire.
if (component.AlarmAutoClose &&
(_atmosAlarmable.TryGetHighestAlert(uid, out var alarm) && alarm != AtmosAlarmType.Danger || alarm == null))
args.Cancel();
}

private void OnAtmosAlarm(EntityUid uid, FirelockComponent component, AtmosAlarmEvent args)
{
if (!this.IsPowered(uid, EntityManager))
Expand Down
2 changes: 0 additions & 2 deletions Content.Shared/Doors/Components/FirelockComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public sealed partial class FirelockComponent : Component
[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>
Expand Down
15 changes: 0 additions & 15 deletions Content.Shared/Doors/Systems/SharedFirelockSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<FirelockComponent, DoorStateChangedEvent>(OnUpdateState);

// Access/Prying
SubscribeLocalEvent<FirelockComponent, BeforeDoorOpenedEvent>(OnBeforeDoorOpened);
SubscribeLocalEvent<FirelockComponent, GetPryTimeModifierEvent>(OnDoorGetPryTimeModifier);
Expand All @@ -46,19 +44,6 @@ public bool EmergencyPressureStop(EntityUid uid, FirelockComponent? firelock = n
return _doorSystem.OnPartialClose(uid, door);
}

private void OnUpdateState(EntityUid uid, FirelockComponent component, DoorStateChangedEvent args)
{
var ev = new BeforeDoorAutoCloseEvent();
RaiseLocalEvent(uid, ev);
UpdateVisuals(uid, component, args);
if (ev.Cancelled)
{
return;
}

_doorSystem.SetNextStateChange(uid, component.AutocloseDelay);
}

#region Access/Prying

private void OnBeforeDoorOpened(EntityUid uid, FirelockComponent component, BeforeDoorOpenedEvent args)
Expand Down
Loading