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
This commit is contained in:
Taran
2023-05-02 21:59:43 +02:00
committed by GitHub
parent 0241d3060d
commit ebca647b5e
+8
View File
@@ -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)