Fixes techfab print runtime for non apc areas (#83768)

## About The Pull Request
Same problem for techfabs as mentioned in #83587

## Changelog
🆑
fix: techfabs don't runtime & hang when printing in no apc areas
/🆑
This commit is contained in:
SyncIt21
2024-06-07 13:32:22 -04:00
committed by GitHub
parent 103fb7c8c4
commit 08ae5a6a9e
@@ -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