From 5febd8103af83f98bdece43198ee0c13b4cecb4a Mon Sep 17 00:00:00 2001 From: "aranclanos@hotmail.com" Date: Thu, 3 Jan 2013 09:25:34 +0000 Subject: [PATCH] Runtime fix for secbots and ED 209 bots trying to handcuff all mob types. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5456 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/machinery/bots/ed209bot.dm | 45 ++++++++++++++++------------ code/game/machinery/bots/secbot.dm | 45 ++++++++++++++++------------ 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index e95457cd7e4..15cabadcdcf 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -318,29 +318,36 @@ Auto Patrol: []"}, mode = SECBOT_HUNT return - if (!src.target.handcuffed && !src.arrest_type) - playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) - mode = SECBOT_ARREST - visible_message("\red [src] is trying to put handcuffs on [src.target]!") + if(istype(src.target,/mob/living/carbon)) + if (!src.target.handcuffed && !src.arrest_type) + playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) + mode = SECBOT_ARREST + visible_message("\red [src] is trying to put handcuffs on [src.target]!") - spawn(60) - if (get_dist(src, src.target) <= 1) - if (src.target.handcuffed) - return + spawn(60) + if (get_dist(src, src.target) <= 1) + if (src.target.handcuffed) + return - if(istype(src.target,/mob/living/carbon)) - src.target.handcuffed = new /obj/item/weapon/handcuffs(src.target) - target.update_inv_handcuffed() //update handcuff overlays + if(istype(src.target,/mob/living/carbon)) + src.target.handcuffed = new /obj/item/weapon/handcuffs(src.target) + target.update_inv_handcuffed() //update handcuff overlays - mode = SECBOT_IDLE - src.target = null - src.anchored = 0 - src.last_found = world.time - src.frustration = 0 + mode = SECBOT_IDLE + src.target = null + src.anchored = 0 + src.last_found = world.time + src.frustration = 0 - // playsound(src.loc, pick('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg'), 50, 0) - // var/arrest_message = pick("Have a secure day!","I AM THE LAW.", "God made tomorrow for the crooks we don't catch today.","You can't outrun a radio.") - // src.speak(arrest_message) + // playsound(src.loc, pick('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg'), 50, 0) + // var/arrest_message = pick("Have a secure day!","I AM THE LAW.", "God made tomorrow for the crooks we don't catch today.","You can't outrun a radio.") + // src.speak(arrest_message) + else + mode = SECBOT_IDLE + src.target = null + src.anchored = 0 + src.last_found = world.time + src.frustration = 0 if(SECBOT_ARREST) // arresting if(src.lasercolor) diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 59f3e0341bd..55d2caddc22 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -259,29 +259,36 @@ Auto Patrol: []"}, mode = SECBOT_HUNT return - if(!src.target.handcuffed && !src.arrest_type) - playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) - mode = SECBOT_ARREST - visible_message("\red [src] is trying to put handcuffs on [src.target]!") + if(istype(src.target,/mob/living/carbon)) + if(!src.target.handcuffed && !src.arrest_type) + playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2) + mode = SECBOT_ARREST + visible_message("\red [src] is trying to put handcuffs on [src.target]!") - spawn(60) - if(get_dist(src, src.target) <= 1) - if(src.target.handcuffed) - return + spawn(60) + if(get_dist(src, src.target) <= 1) + if(src.target.handcuffed) + return - if(istype(src.target,/mob/living/carbon)) - target.handcuffed = new /obj/item/weapon/handcuffs(target) - target.update_inv_handcuffed() //update the handcuffs overlay + if(istype(src.target,/mob/living/carbon)) + target.handcuffed = new /obj/item/weapon/handcuffs(target) + target.update_inv_handcuffed() //update the handcuffs overlay - mode = SECBOT_IDLE - src.target = null - src.anchored = 0 - src.last_found = world.time - src.frustration = 0 + mode = SECBOT_IDLE + src.target = null + src.anchored = 0 + src.last_found = world.time + src.frustration = 0 - playsound(src.loc, pick('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg'), 50, 0) - // var/arrest_message = pick("Have a secure day!","I AM THE LAW.", "God made tomorrow for the crooks we don't catch today.","You can't outrun a radio.") - // src.speak(arrest_message) + playsound(src.loc, pick('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg'), 50, 0) + // var/arrest_message = pick("Have a secure day!","I AM THE LAW.", "God made tomorrow for the crooks we don't catch today.","You can't outrun a radio.") + // src.speak(arrest_message) + else + mode = SECBOT_IDLE + src.target = null + src.anchored = 0 + src.last_found = world.time + src.frustration = 0 if(SECBOT_ARREST) // arresting