From 6ea88aecfdc3f85c4937f306fe877aad9329f7f8 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Sun, 25 May 2014 13:10:44 +1200 Subject: [PATCH] Bot attack fix - Fixes bots attacking through windows Conflicts: code/game/machinery/bots/ed209bot.dm code/game/machinery/bots/medbot.dm code/game/machinery/bots/secbot.dm --- code/game/machinery/bots/ed209bot.dm | 4 +--- code/game/machinery/bots/medbot.dm | 3 ++- code/game/machinery/bots/secbot.dm | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 7092aec2633..189a20f0981 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -271,9 +271,7 @@ Auto Patrol: []"}, walk_to(src,0) if (target) // make sure target exists - if(!istype(target.loc, /turf)) - return - if (get_dist(src, src.target) <= 1) // if right next to perp + if (Adjacent(target)) // if right next to perp playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) src.icon_state = "[lasercolor]ed209-c" spawn(2) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index 265467e2563..52bfe7c65bd 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -285,7 +285,8 @@ if(!src.path) src.path = new() - if(src.patient && (get_dist(src,src.patient) <= 1)) + + if(src.patient && Adjacent(patient)) if(!src.currently_healing) src.currently_healing = 1 src.frustration = 0 diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index e1b9c645f83..588e8691990 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -219,9 +219,7 @@ Auto Patrol: []"}, walk_to(src,0) if(target) // make sure target exists - if(!istype(target.loc, /turf)) - return - if(get_dist(src, src.target) <= 1) // if right next to perp + if(Adjacent(target)) // if right next to perp if(istype(src.target,/mob/living/carbon)) playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) src.icon_state = "secbot-c"