From b35fb981164e48865d689cd0a9668319bab8d617 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Sun, 5 Aug 2012 20:41:48 +0000 Subject: [PATCH] -Fixed a bug where the AI could not repower itself if the APC's equipment was turned off. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4323 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/mob/living/silicon/ai/life.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 8389aec7755..e36bcc26a85 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -141,10 +141,12 @@ */ var/PRP //like ERP with the code, at least this stuff is no more 4x sametext for (PRP=1, PRP<=4, PRP++) - for (var/obj/machinery/power/apc/APC in loc) - if (!(APC.stat & BROKEN)) - theAPC = APC - break + var/area/AIarea = get_area(src) + for(var/area/A in AIarea.master.related) + for (var/obj/machinery/power/apc/APC in A) + if (!(APC.stat & BROKEN)) + theAPC = APC + break if (!theAPC) switch(PRP) if (1) src << "Unable to locate APC!"