From c39b89514b5a9adbc6b3286fa554d8ef4694ce98 Mon Sep 17 00:00:00 2001 From: "VivianFoxfoot@gmail.com" Date: Sat, 17 Mar 2012 15:35:54 +0000 Subject: [PATCH] Shuffles the order of the code a bit to make it so intelicarded AIs with no wireless cannot use keyboard shortcuts to affect doors. Different fix to make AIs able to hear when being carried. Shouldn't be that much of a cpu burden, although if anyone has better ideas on how to do it git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3318 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/procs/gamehelpers.dm | 8 +++++++ code/game/atom_procs.dm | 35 ++++++++++++++++++------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/code/defines/procs/gamehelpers.dm b/code/defines/procs/gamehelpers.dm index 6146f860b1d..581b57d189a 100644 --- a/code/defines/procs/gamehelpers.dm +++ b/code/defines/procs/gamehelpers.dm @@ -124,6 +124,14 @@ if(M.client) hear += M + // Kind of a hacky fix, but should fix most cases without undo issues. + for(var/mob/M as mob in V) + for(var/obj/item/device/aicard/C in M.contents) + for(var/mob/living/silicon/ai/A in C) + if(isInSight(source,A)) + if(A.client) + hear += A + // Brains/MMIs/pAIs for(var/mob/living/carbon/brain/C in world) if(get_turf(C) in V) diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index 10c8a1a6fac..09629535ca3 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -697,6 +697,26 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl if(src.pixel_x < -16) usr.dir = 8 + + + + // ------- AI ------- + if (istype(usr, /mob/living/silicon/ai)) + var/mob/living/silicon/ai/ai = usr + if (ai.control_disabled) + return + + // ------- CYBORG ------- + if (istype (usr, /mob/living/silicon/robot)) + var/mob/living/silicon/robot/bot = usr + if (bot.lockcharge) return + ..() + + + + + + // ------- SHIFT-CLICK ------- var/parameters = params2list(params) @@ -729,21 +749,6 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl return } - - - - // ------- AI ------- - if (istype(usr, /mob/living/silicon/ai)) - var/mob/living/silicon/ai/ai = usr - if (ai.control_disabled) - return - - // ------- CYBORG ------- - if (istype (usr, /mob/living/silicon/robot)) - var/mob/living/silicon/robot/bot = usr - if (bot.lockcharge) return - ..() - // ------- THROW ------- if(usr.in_throw_mode) return usr:throw_item(src)