From 0095d9e2040bc27094893920665643db3db67621 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 21 Dec 2023 18:58:53 -0500 Subject: [PATCH] ARES Apollo Check proc --- code/game/machinery/ARES/ARES_procs.dm | 12 ++++++++++-- code/game/machinery/ARES/ARES_step_triggers.dm | 4 ++-- code/modules/admin/tabs/event_tab.dm | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 06b082e3c5e2..109058dba3c6 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -103,12 +103,20 @@ GLOBAL_LIST_INIT(maintenance_categories, list( return TRUE return FALSE //CPU not found or is broken -/proc/log_ares_apollo(speaker, message) - if(!ares_can_log()) +/proc/ares_can_apollo() + if(!istype(GLOB.ares_link) || !istype(GLOB.ares_datacore)) return FALSE var/datum/ares_link/link = GLOB.ares_link if(!link.processor_apollo || link.processor_apollo.inoperable()) return FALSE + return TRUE + +/proc/log_ares_apollo(speaker, message) + if(!ares_can_log()) + return FALSE + if(!ares_can_apollo()){ + return FALSE + } if(!speaker) speaker = "Unknown" var/datum/ares_datacore/datacore = GLOB.ares_datacore diff --git a/code/game/machinery/ARES/ARES_step_triggers.dm b/code/game/machinery/ARES/ARES_step_triggers.dm index fdf7b26b2e65..2c6d605bcc9b 100644 --- a/code/game/machinery/ARES/ARES_step_triggers.dm +++ b/code/game/machinery/ARES/ARES_step_triggers.dm @@ -69,7 +69,7 @@ broadcast_message = "ALERT: Unauthorized movement detected in [area_name]!" var/datum/ares_link/link = GLOB.ares_link - if(link.processor_apollo.inoperable()) + if(!ares_can_apollo()) return FALSE to_chat(passer, SPAN_BOLDWARNING("You hear a soft beeping sound as you cross the threshold.")) @@ -154,7 +154,7 @@ var/broadcast_message = get_broadcast(passer, idcard, failure) var/datum/ares_link/link = GLOB.ares_link - if(link.processor_apollo.inoperable()) + if(!ares_can_apollo()) return FALSE to_chat(passer, SPAN_BOLDWARNING("You hear a harsh buzzing sound as you cross the threshold!")) diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 830717ef91b9..477a6c0144f0 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -598,7 +598,7 @@ return FALSE var/datum/ares_link/link = GLOB.ares_link - if(link.processor_apollo.inoperable()) + if(!ares_can_apollo()) var/prompt = tgui_alert(src, "ARES APOLLO processor is offline or destroyed, send the message anyways?", "Choose.", list("Yes", "No"), 20 SECONDS) if(prompt != "Yes") to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is not responding. It's APOLLO processor may be offline or destroyed."))