From c6e2da83b3ba60c4c6f94b714c1e7724a3f0b68e Mon Sep 17 00:00:00 2001 From: "quartz235@gmail.com" Date: Mon, 19 Dec 2011 23:48:09 +0000 Subject: [PATCH] fixes for issue 260 issue 262 and issue 263 git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2747 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/items.dm | 77 ++++++++++++++++++++------------------ code/modules/mob/screen.dm | 4 +- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index b8aacbd87e8..39b0a1e8a8b 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -30,49 +30,52 @@ if ((usr.mutations & CLUMSY) && prob(50)) usr << "\red Uh ... how do those things work?!" if (istype(M, /mob/living/carbon/human)) - var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) - O.source = user - O.target = user - O.item = user.equipped() - O.s_loc = user.loc - O.t_loc = user.loc - O.place = "handcuff" - M.requests += O - spawn( 0 ) - O.process() - return + if(!M.handcuffed) + var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) + O.source = user + O.target = user + O.item = user.equipped() + O.s_loc = user.loc + O.t_loc = user.loc + O.place = "handcuff" + M.requests += O + spawn( 0 ) + O.process() + return return if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") usr << "\red You don't have the dexterity to do this!" return if (istype(M, /mob/living/carbon/human)) - M.attack_log += text("\[[time_stamp()]\] Has been handcuffed (attempt) by [user.name] ([user.ckey])") - user.attack_log += text("\[[time_stamp()]\] Attempted to handcuff [M.name] ([M.ckey])") - var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) - O.source = user - O.target = M - O.item = user.equipped() - O.s_loc = user.loc - O.t_loc = M.loc - O.place = "handcuff" - M.requests += O - spawn( 0 ) - playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) - O.process() - return + if(!M.handcuffed) + M.attack_log += text("\[[time_stamp()]\] Has been handcuffed (attempt) by [user.name] ([user.ckey])") + user.attack_log += text("\[[time_stamp()]\] Attempted to handcuff [M.name] ([M.ckey])") + var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) + O.source = user + O.target = M + O.item = user.equipped() + O.s_loc = user.loc + O.t_loc = M.loc + O.place = "handcuff" + M.requests += O + spawn( 0 ) + playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) + O.process() + return else - var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( ) - O.source = user - O.target = M - O.item = user.equipped() - O.s_loc = user.loc - O.t_loc = M.loc - O.place = "handcuff" - M.requests += O - spawn( 0 ) - playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) - O.process() - return + if(!M.handcuffed) + var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( ) + O.source = user + O.target = M + O.item = user.equipped() + O.s_loc = user.loc + O.t_loc = M.loc + O.place = "handcuff" + M.requests += O + spawn( 0 ) + playsound(src.loc, 'handcuffs.ogg', 30, 1, -2) + O.process() + return return diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index 271c808e5a0..12cd5d3b43d 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -432,7 +432,7 @@ O.show_message(text("\red [] is trying to break the handcuffs!", usr), 1) spawn(0) if(do_after(usr, 50)) - if(!usr:handcuffed) return + if(!usr:handcuffed || usr.moved_recently || usr:buckled) return for(var/mob/O in viewers(usr)) O.show_message(text("\red [] manages to break the handcuffs!", usr), 1) usr << "\green You successfully break your handcuffs." @@ -444,7 +444,7 @@ O.show_message(text("\red [] attempts to remove the handcuffs!", usr), 1) spawn(0) if(do_after(usr, 1200)) - if(!usr:handcuffed) return + if(!usr:handcuffed || usr.moved_recently || usr:buckled) return for(var/mob/O in viewers(usr)) O.show_message(text("\red [] manages to remove the handcuffs!", usr), 1) usr << "\blue You successfully remove your handcuffs."