From 08ae5a6a9e7f9bcc369405e3b98802e7a42a0d95 Mon Sep 17 00:00:00 2001 From: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Date: Fri, 7 Jun 2024 23:02:22 +0530 Subject: [PATCH] Fixes techfab print runtime for non apc areas (#83768) ## About The Pull Request Same problem for techfabs as mentioned in #83587 ## Changelog :cl: fix: techfabs don't runtime & hang when printing in no apc areas /:cl: --- code/modules/research/machinery/_production.dm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index cc6a45a5f1f..16ccedaf778 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -384,11 +384,14 @@ if(!directly_use_energy(charge_per_item)) // provide the wait time until lathe is ready var/area/my_area = get_area(src) var/obj/machinery/power/apc/my_apc = my_area.apc - var/charging_wait = my_apc.time_to_charge(charge_per_item) - if(!isnull(charging_wait)) - say("Unable to continue production, APC overload. Wait [DisplayTimeText(charging_wait, round_seconds_to = 1)] and try again.") + if(!QDELETED(my_apc)) + var/charging_wait = my_apc.time_to_charge(charge_per_item) + if(!isnull(charging_wait)) + say("Unable to continue production, APC overload. Wait [DisplayTimeText(charging_wait, round_seconds_to = 1)] and try again.") + else + say("Unable to continue production, power grid overload.") else - say("Unable to continue production, power grid overload.") + say("Unable to continue production, no APC in area.") finalize_build() return