mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
Fire alarms now eventually stop blaring (#28518)
* Fire Alarms eventually stop making sounds * Change testing time * Fixups * Apply suggestions from code review Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: ExusA <67055922+ExusA@users.noreply.github.com> --------- Signed-off-by: ExusA <67055922+ExusA@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
@@ -61,6 +61,8 @@
|
||||
var/list/firealarms
|
||||
var/firedoors_last_closed_on = 0
|
||||
|
||||
/// Timer to stop ongoing fire alarm sounds
|
||||
var/firealarm_sound_stop_timer = null
|
||||
/// The air alarms present in this area.
|
||||
var/list/air_alarms = list()
|
||||
/// The list of vents in our area.
|
||||
@@ -338,6 +340,8 @@
|
||||
var/obj/machinery/firealarm/F = item
|
||||
F.update_icon()
|
||||
GLOB.firealarm_soundloop.start(F)
|
||||
if(!firealarm_sound_stop_timer)
|
||||
firealarm_sound_stop_timer = addtimer(CALLBACK(src, PROC_REF(stop_alarm_sounds)), 4 MINUTES, TIMER_STOPPABLE | TIMER_UNIQUE)
|
||||
|
||||
for(var/thing in cameras)
|
||||
var/obj/machinery/camera/C = locateUID(thing)
|
||||
@@ -348,6 +352,10 @@
|
||||
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/area/proc/stop_alarm_sounds()
|
||||
for(var/obj/machinery/firealarm/F in firealarms)
|
||||
F.update_icon()
|
||||
GLOB.firealarm_soundloop.stop(F)
|
||||
/**
|
||||
* Reset the firealarm alert for this area
|
||||
*
|
||||
@@ -360,6 +368,9 @@
|
||||
if(fire)
|
||||
unset_fire_alarm_effects()
|
||||
ModifyFiredoors(TRUE)
|
||||
if(firealarm_sound_stop_timer)
|
||||
deltimer(firealarm_sound_stop_timer)
|
||||
firealarm_sound_stop_timer = null
|
||||
for(var/item in firealarms)
|
||||
var/obj/machinery/firealarm/F = item
|
||||
F.update_icon()
|
||||
|
||||
Reference in New Issue
Block a user