From ebca647b5e94e25ec7116804d463c737d1e235b2 Mon Sep 17 00:00:00 2001 From: Taran Date: Tue, 2 May 2023 13:59:43 -0600 Subject: [PATCH] turns off fire alarm sounds when power is off (#20956) * turns off alarm sounds when power is off when power is turned off a given fire alarm will stop playing the alarm sound. * resumes alarm when power returns firealarm sound returns when power is restored --- code/game/machinery/firealarm.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 3d8bf4848d6..bcd697ce590 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -237,11 +237,19 @@ FIRE ALARM else set_light(l_power = LIGHTING_MINIMUM_POWER) +/obj/machinery/firealarm/proc/update_fire_sound(fire) + var/area/A = get_area(src) + if(stat & NOPOWER) + GLOB.firealarm_soundloop.stop(src, TRUE) + else if(A.fire) + GLOB.firealarm_soundloop.start(src) + /obj/machinery/firealarm/power_change() if(!..()) return update_fire_light() update_icon() + update_fire_sound() /obj/machinery/firealarm/attack_hand(mob/user) if(stat & (NOPOWER|BROKEN) || buildstage != 2)