Fix firelock prediction issues with periodic pulses of closing lights (#28227)
* Fix firelock prediction issues with periodic pulses of closing lights For some reason this function was setting a time for the next state which was triggering the door system to try to close the firelock. This does not happen serverside because the function only fires from an event called clientside apparently. It appears to be an attempt to stop firelocks from closing instantly that did not function properly, and I cannot discern any other purpose. As such I have removed it. * Remove redundant serverside check This became redundant with commit 439a87f2
This commit is contained in:
@@ -28,8 +28,6 @@ namespace Content.Server.Doors.Systems
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
SubscribeLocalEvent<FirelockComponent, BeforeDoorAutoCloseEvent>(OnBeforeDoorAutoclose);
|
||||
SubscribeLocalEvent<FirelockComponent, AtmosAlarmEvent>(OnAtmosAlarm);
|
||||
|
||||
SubscribeLocalEvent<FirelockComponent, PowerChangedEvent>(PowerChanged);
|
||||
@@ -80,19 +78,6 @@ namespace Content.Server.Doors.Systems
|
||||
}
|
||||
}
|
||||
|
||||
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))
|
||||
|
||||
@@ -19,8 +19,6 @@ namespace Content.Shared.Doors.Components
|
||||
[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>
|
||||
|
||||
@@ -18,8 +18,6 @@ public abstract class SharedFirelockSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<FirelockComponent, DoorStateChangedEvent>(OnUpdateState);
|
||||
|
||||
// Access/Prying
|
||||
SubscribeLocalEvent<FirelockComponent, BeforeDoorOpenedEvent>(OnBeforeDoorOpened);
|
||||
SubscribeLocalEvent<FirelockComponent, GetPryTimeModifierEvent>(OnDoorGetPryTimeModifier);
|
||||
@@ -46,19 +44,6 @@ public abstract class SharedFirelockSystem : EntitySystem
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user