fixes firelock alarm sync, removes check condition for syncalerts packet receive when checking through the sent dictionary

This commit is contained in:
vulppine
2022-08-22 07:29:43 -07:00
parent 374c62703b
commit a8bf2ccbb6
2 changed files with 2 additions and 4 deletions

View File

@@ -109,8 +109,6 @@ namespace Content.Server.Atmos.Monitor.Systems
Reset(uid, component); Reset(uid, component);
break; break;
case SyncAlerts: case SyncAlerts:
// Synchronize alerts, but only if they're already known by this monitor.
// This should help eliminate the chain effect, especially with
if (!args.Data.TryGetValue(SyncAlerts, if (!args.Data.TryGetValue(SyncAlerts,
out IReadOnlyDictionary<string, AtmosMonitorAlarmType>? alarms)) out IReadOnlyDictionary<string, AtmosMonitorAlarmType>? alarms))
{ {
@@ -119,7 +117,7 @@ namespace Content.Server.Atmos.Monitor.Systems
foreach (var (key, alarm) in alarms) foreach (var (key, alarm) in alarms)
{ {
if (component.NetworkAlarmStates.ContainsKey(key)) if (!component.NetworkAlarmStates.TryAdd(key, alarm))
{ {
component.NetworkAlarmStates[key] = alarm; component.NetworkAlarmStates[key] = alarm;
} }

View File

@@ -7,7 +7,7 @@
- type: AtmosAlarmable - type: AtmosAlarmable
syncWith: syncWith:
- FireAlarm - FireAlarm
- AirSensor - AirAlarm
- type: ApcPowerReceiver - type: ApcPowerReceiver
- type: ExtensionCableReceiver - type: ExtensionCableReceiver
- type: DeviceNetwork - type: DeviceNetwork