From c9baf8b2264fa6ee1dfcbf22fa67937e33e26b9f Mon Sep 17 00:00:00 2001 From: LaharlMontogmmery Date: Mon, 18 Nov 2013 11:46:04 +0100 Subject: [PATCH] Unanchored AIs can now be pushed and can bump. --- code/modules/mob/living/silicon/ai/ai.dm | 27 +++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index e75f77d7fcb..470917d53f4 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -18,7 +18,7 @@ var/list/ai_list = list() icon_state = "ai" anchored = 1 // -- TLE density = 1 - status_flags = CANSTUN|CANPARALYSE + status_flags = CANSTUN|CANPARALYSE|CANPUSH var/list/network = list("SS13") var/obj/machinery/camera/current = null var/list/connected_robots = list() @@ -274,6 +274,31 @@ var/list/ai_list = list() /mob/living/silicon/ai/update_canmove() return 0 +/mob/living/silicon/ai/Bump(atom/movable/AM as mob|obj, yes) + if ((!( yes ) || now_pushing)) + return + now_pushing = 1 + if(ismob(AM)) + var/mob/tmob = AM + if(!(tmob.status_flags & CANPUSH)) + now_pushing = 0 + return + now_pushing = 0 + ..() + if (!istype(AM, /atom/movable)) + return + if (!now_pushing) + now_pushing = 1 + if (!AM.anchored) + var/t = get_dir(src, AM) + if (istype(AM, /obj/structure/window)) + if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST) + for(var/obj/structure/window/win in get_step(AM,t)) + now_pushing = 0 + return + step(AM, t) + now_pushing = null + /mob/living/silicon/ai/proc/ai_cancel_call() set category = "AI Commands" if(src.stat == 2)