Fixes reset propagation for atmospheric alarm receivers, adds CVar for fire alarm all access (#11020)

* adds a check for if a firelock is powered before auto-opening

* fixes issue where resets would not propagate properly

* adds cvar bound for fire alarm access (defaults to all access)
This commit is contained in:
Flipp Syder
2022-09-05 18:15:50 -07:00
committed by GitHub
parent 8114d9d614
commit 8cbcf2d640
4 changed files with 37 additions and 15 deletions

View File

@@ -3,12 +3,15 @@ using Content.Server.Atmos.Monitor.Components;
using Content.Server.DeviceNetwork.Systems;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Shared.Access.Systems;
using Content.Shared.AlertLevel;
using Content.Shared.Atmos.Monitor;
using Content.Shared.CCVar;
using Content.Shared.DeviceNetwork;
using Content.Shared.Interaction;
using Content.Shared.Emag.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
namespace Content.Server.Atmos.Monitor.Systems;
@@ -17,6 +20,8 @@ public sealed class FireAlarmSystem : EntitySystem
[Dependency] private readonly AtmosDeviceNetworkSystem _atmosDevNet = default!;
[Dependency] private readonly AtmosAlarmableSystem _atmosAlarmable = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly AccessReaderSystem _access = default!;
[Dependency] private readonly IConfigurationManager _configManager = default!;
public override void Initialize()
{
@@ -36,6 +41,9 @@ public sealed class FireAlarmSystem : EntitySystem
if (!_interactionSystem.InRangeUnobstructed(args.User, args.Target))
return;
if (!_configManager.GetCVar(CCVars.FireAlarmAllAccess) && !_access.IsAllowed(args.User, args.Target))
return;
if (this.IsPowered(uid, EntityManager))
{
if (!_atmosAlarmable.TryGetHighestAlert(uid, out var alarm))