From 6d1d18a585b2645ce104946266086f8d5bf7366a Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sun, 23 Oct 2016 21:31:12 -0500 Subject: [PATCH] Kills telecuffs --- code/game/objects/items/weapons/handcuffs.dm | 23 +++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index e6962669dc..a3c5d33d67 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -35,20 +35,20 @@ return //check for an aggressive grab (or robutts) - var/can_place - if(istype(user, /mob/living/silicon/robot)) - can_place = 1 - else - for (var/obj/item/weapon/grab/G in C.grabbed_by) - if (G.loc == user && G.state >= GRAB_AGGRESSIVE) - can_place = 1 - break - - if(can_place) + if(can_place(C, user)) place_handcuffs(C, user) else user << "You need to have a firm grip on [C] before you can put \the [src] on!" +/obj/item/weapon/handcuffs/proc/can_place(var/mob/target, var/mob/user) + if(istype(user, /mob/living/silicon/robot)) + return 1 + else + for(var/obj/item/weapon/grab/G in target.grabbed_by) + if(G.loc == user && G.state >= GRAB_AGGRESSIVE) + return 1 + return 0 + /obj/item/weapon/handcuffs/proc/place_handcuffs(var/mob/living/carbon/target, var/mob/user) playsound(src.loc, cuff_sound, 30, 1, -2) @@ -69,6 +69,9 @@ if(!do_after(user,30)) return 0 + if(!can_place(target, user)) //victim may have resisted out of the grab in the meantime + return 0 + H.attack_log += text("\[[time_stamp()]\] Has been handcuffed (attempt) by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Attempted to handcuff [H.name] ([H.ckey])") msg_admin_attack("[key_name(user)] attempted to handcuff [key_name(H)]")