Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fire alarms now eventually stop blaring #28518

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
firealarm_sound_stop_timer = addtimer(CALLBACK(src, PROC_REF(stop_alarm_sounds)), 4 MINUTES, TIMER_STOPPABLE || TIMER_UNIQUE)
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)
Expand All @@ -348,6 +352,11 @@

START_PROCESSING(SSobj, src)

/area/proc/stop_alarm_sounds()
for(var/item in firealarms)
var/obj/machinery/firealarm/F = item
Comment on lines +356 to +357
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for(var/item in firealarms)
var/obj/machinery/firealarm/F = item
for(var/obj/machinery/firealarm/F in firealarms)

F.update_icon()
GLOB.firealarm_soundloop.stop(F)
/**
* Reset the firealarm alert for this area
*
Expand All @@ -360,6 +369,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()
Expand Down