diff --git a/code/modules/modular_computers/file_system/programs/alarm.dm b/code/modules/modular_computers/file_system/programs/alarm.dm index 1979672080d..f3cb91bc292 100644 --- a/code/modules/modular_computers/file_system/programs/alarm.dm +++ b/code/modules/modular_computers/file_system/programs/alarm.dm @@ -26,20 +26,6 @@ QDEL_NULL(alert_control) return ..() -/datum/computer_file/program/alarm_monitor/process_tick(seconds_per_tick) - ..() - - if(has_alert) - program_icon_state = "alert-red" - ui_header = "alarm_red.gif" - update_computer_icon() - else - if(!has_alert) - program_icon_state = "alert-green" - ui_header = "alarm_green.gif" - update_computer_icon() - return 1 - /datum/computer_file/program/alarm_monitor/ui_data(mob/user) var/list/data = list() data += alert_control.ui_data(user) @@ -47,9 +33,19 @@ /datum/computer_file/program/alarm_monitor/proc/update_alarm_display() SIGNAL_HANDLER - has_alert = FALSE - if(length(alert_control.listener.alarms)) - has_alert = TRUE + // has_alert is true if there are any active alarms in our listener. + has_alert = (length(alert_control.listener.alarms) > 0) + + if(!has_alert) + program_icon_state = "alert-green" + ui_header = "alarm_green.gif" + else + // If we don't know the status, assume the worst. + // Technically we should never have anything other than a truthy or falsy value + // but this will allow for unknown values to fall through to be an actual alert. + program_icon_state = "alert-red" + ui_header = "alarm_red.gif" + update_computer_icon() // Always update the icon after we check our conditional because we might've changed it /datum/computer_file/program/alarm_monitor/on_start(mob/user) . = ..(user)