Skip to content

Commit

Permalink
Merge pull request #167 from Huz2e/alarms
Browse files Browse the repository at this point in the history
Alarms
  • Loading branch information
Huz2e authored Jul 29, 2024
2 parents 8f356e6 + 7b6f22b commit 8c5b3cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
14 changes: 9 additions & 5 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
/obj/machinery/door/firedoor/proc/start_activation_process(code = FIRELOCK_ALARM_TYPE_GENERIC)
if(active)
return //We're already active
soundloop.start()
// soundloop.start() //MASSMETA EDIT REMOVAL
is_playing_alarm = TRUE
my_area.fault_status = AREA_FAULT_AUTOMATIC
my_area.fault_location = name
Expand All @@ -342,7 +342,7 @@
* in the merge group datum. sets our alarm type to null, signifying no alarm.
*/
/obj/machinery/door/firedoor/proc/start_deactivation_process()
soundloop.stop()
// soundloop.stop() //MASSMETA EDIT REMOVAL
is_playing_alarm = FALSE
my_area.fault_status = AREA_FAULT_NONE
my_area.fault_location = null
Expand Down Expand Up @@ -397,7 +397,7 @@
alarm_type = null
active = FALSE
remove_as_source()
soundloop.stop()
// soundloop.stop() //MASSMETA EDIT REMOVAL
is_playing_alarm = FALSE
update_appearance(UPDATE_ICON) //Sets the door lights even if the door doesn't move.
correct_state()
Expand All @@ -414,7 +414,7 @@
if(!length(issue_turfs)) // Generic alarms get out
alarm_type = null

soundloop.stop()
// soundloop.stop() //MASSMETA EDIT REMOVAL
is_playing_alarm = FALSE
remove_as_source()
update_appearance(UPDATE_ICON) //Sets the door lights even if the door doesn't move.
Expand Down Expand Up @@ -469,15 +469,19 @@
/obj/machinery/door/firedoor/proc/on_power_loss()
SIGNAL_HANDLER

soundloop.stop()
// soundloop.stop() //MASSMETA EDIT REMOVAL

/obj/machinery/door/firedoor/proc/on_power_restore()
SIGNAL_HANDLER

correct_state()

// MASSMETA EDIT REMOVAL BEGIN
/*
if(is_playing_alarm)
soundloop.start()
*/
// MASSMETA EDIT REMOVAL END


/obj/machinery/door/firedoor/attack_hand(mob/living/user, list/modifiers)
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/firealarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@
/obj/machinery/firealarm/proc/set_status()
if(!(my_area.fire || LAZYLEN(my_area.active_firelocks)) || (obj_flags & EMAGGED))
soundloop.stop()
// MASSMETA EDIT ADDITION START
else
soundloop.start()
// MASSMETA EDIT ADDITION END
update_appearance()

/obj/machinery/firealarm/update_appearance(updates)
Expand Down Expand Up @@ -252,6 +256,7 @@
return

if(my_area.fire)
soundloop.start() // MASSMETA EDIT ADDITION
return //area alarm already active
my_area.alarm_manager.send_alarm(ALARM_FIRE, my_area)
// This'll setup our visual effects, so we only need to worry about the alarm
Expand Down

0 comments on commit 8c5b3cc

Please sign in to comment.