From de5c059a014ff1f48eb55b2334bd9c638b419e4a Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sat, 22 Nov 2014 11:46:51 +0100 Subject: [PATCH] AI disposal interaction. The AI can now interact with disposal units and turn the pump on/off. --- code/modules/recycling/disposal.dm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index bf77c47d59c..3b5d5a197a2 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -270,14 +270,15 @@ if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1 usr << "\red The disposal units power is disabled." return - ..() - src.add_fingerprint(usr) + if(..()) + return + if(stat & BROKEN) return if(usr.stat || usr.restrained() || src.flushing) return - if (in_range(src, usr) && istype(src.loc, /turf)) + if(istype(src.loc, /turf)) usr.set_machine(src) if(href_list["close"]) @@ -292,12 +293,13 @@ mode = 0 update() - if(href_list["handle"]) - flush = text2num(href_list["handle"]) - update() + if(!isAI(usr)) + if(href_list["handle"]) + flush = text2num(href_list["handle"]) + update() - if(href_list["eject"]) - eject() + if(href_list["eject"]) + eject() else usr << browse(null, "window=disposal") usr.unset_machine()