From 3c4ff5e0bbc2053e0c86f116df727009a71896bb Mon Sep 17 00:00:00 2001 From: LorenLuke Date: Mon, 24 Apr 2017 15:43:07 -0700 Subject: [PATCH 1/2] Can now apply handcuffs to oneself. --- code/game/objects/items/weapons/handcuffs.dm | 5 +-- html/changelogs/LorenLuke - Handcuffs.yml | 36 ++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 html/changelogs/LorenLuke - Handcuffs.yml diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 1190d7f8120..99a4d7bca83 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -41,9 +41,10 @@ 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(user == target) + return 1 if(istype(user, /mob/living/silicon/robot)) - if(user.Adjacent(target)) - return 1 + return 1 else for(var/obj/item/weapon/grab/G in target.grabbed_by) if(G.loc == user && G.state >= GRAB_AGGRESSIVE) diff --git a/html/changelogs/LorenLuke - Handcuffs.yml b/html/changelogs/LorenLuke - Handcuffs.yml new file mode 100644 index 00000000000..a0774083cf2 --- /dev/null +++ b/html/changelogs/LorenLuke - Handcuffs.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: LorenLuke + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "You can now put handcuffs on yourself." From c0be57b2009a27b6b6b1e93bad6bff95806becdd Mon Sep 17 00:00:00 2001 From: LorenLuke Date: Tue, 25 Apr 2017 10:55:21 -0700 Subject: [PATCH 2/2] Adds adjacency check. --- code/game/objects/items/weapons/handcuffs.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 99a4d7bca83..62941c24f08 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -44,7 +44,8 @@ if(user == target) return 1 if(istype(user, /mob/living/silicon/robot)) - return 1 + if(user.Adjacent(target)) + return 1 else for(var/obj/item/weapon/grab/G in target.grabbed_by) if(G.loc == user && G.state >= GRAB_AGGRESSIVE)