]> git.smokeofanarchy.ru Git - space-station-14.git/commit
Check air alarm sensors when repowering (#29857)
authorPartmedia <kevinz5000@gmail.com>
Thu, 29 Aug 2024 02:43:27 +0000 (18:43 -0800)
committerGitHub <noreply@github.com>
Thu, 29 Aug 2024 02:43:27 +0000 (18:43 -0800)
commita9602cbab307dcf6597200888ec5842bdb4c267b
tree619ce2afb92ee7c3ec4e946a32a423c3fcadaecb
parent6a52de86ffe76d1462744b74c97e01e5bb27109c
parent303b5c8393e1fad157326d0718a5da47cb92df65
Check air alarm sensors when repowering (#29857)

If air sensor/vent detects danger while the air alarm is unpowered, the air alarm won't be updated accordingly when it gains power. This can cause situations where the alarm says that everything's normal, even though the alarm UI shows stuff like 10000kPa and all sensors display danger.

When AtmosAlarmable (air alarm) is powered on, it runs the Sync method of AtmosDeviceNetworkSystem. AtmosMonitors then answer by sending a SyncData packet back, however AtmosAlarmable doesn't handle this packet in any way. This happens because the packet doesn't have any tags set, so they are ignored, and even if they weren't, there's no case in the switch statement which handles the syncing.

The proper way to do this fix is probably by actually handling this packet in some way, but I'm lazy rn so I'll just use this quick fix: Whenever AtmosMonitor gets a request to sync, it runs the Alert method, informing the connected air alarms of it's current state.
Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs