Files
Bubberstation/code/modules/mapping/mapping_helpers.dm
Tim 5c6eb2ce57 Fix air alarms to work correctly while connected to a gas sensor (#86958)
## About The Pull Request
This fixes a bug that was hard to troubleshoot. While I was testing my
other PR, I noticed that I was getting inconsistent atmos readouts while
using a gas sensor hooked to an air alarm. Sometimes I would get the
readout from the tile of the air alarm, and other times it would give me
the readout of the gas sensor... I tracked it down and the root cause
was the `COMSIG_TURF_EXPOSE` signal not being properly reassigned when a
gas sensor was connected.

My fix is to transfer the signal from the air alarm to the air sensor
and vice versa when they are connected/disconnected. I also added some
redundancies in place to limit air sensors to be only connected to one
air alarm at a time. I threw in a mapping check to make sure one air
alarm isn't linked to multiple sensors to catch some accidents.

Another small fix is that air alarms now can be relinked to other air
sensors if the sensor is reset. This was a problem for round-start
linked air alarms that were paired with sensors since you could turn off
or break a sensor and then the air alarm would have it's link severed
without being able to link to any new sensors.

## Why It's Good For The Game
Air alarms are becoming more robust!

## Changelog
🆑
fix: Fix air alarms to work correctly while connected to a gas sensor
fix: Fix paired air alarms and sensors to be able to relink to other
devices if turned off, reset, or destroyed.
/🆑
2024-11-11 00:41:54 -08:00

54 KiB