From 7fbe6d05a18fb5ccb89c2eb4454e4af6572aea02 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Sat, 24 Feb 2018 16:57:53 -0500 Subject: [PATCH] POLARIS: Make cryopods check area first, then range The bug referenced hasn't existed for quite a while. We'll keep the range check as a fallback, though. --- code/game/machinery/cryopod.dm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index f5fad1e765..cb5559a18f 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -306,13 +306,18 @@ find_control_computer() /obj/machinery/cryopod/proc/find_control_computer(urgent=0) - //control_computer = locate(/obj/machinery/computer/cryopod) in src.loc.loc // Broken due to http://www.byond.com/forum/?post=2007448 - control_computer = locate(/obj/machinery/computer/cryopod) in range(6,src) + control_computer = null + + var/area/my_area = get_area(src) + control_computer = locate(/obj/machinery/computer/cryopod) in my_area + + if(!control_computer) //Fallback to old method. + control_computer = locate(/obj/machinery/computer/cryopod) in range(6,src) // Don't send messages unless we *need* the computer, and less than five minutes have passed since last time we messaged - if(!control_computer && urgent && last_no_computer_message + 5*60*10 < world.time) - log_admin("Cryopod in [src.loc.loc] could not find control computer!") - message_admins("Cryopod in [src.loc.loc] could not find control computer!") + if(!control_computer && urgent && last_no_computer_message + 5 MINUTES < world.time) + log_admin("Cryopod in [my_area] could not find control computer!") + message_admins("Cryopod in [my_area] could not find control computer!") last_no_computer_message = world.time return control_computer != null