From 58700869fe723f54e1bee84fe15eb52f860fc75f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jun 2014 12:35:00 -0400 Subject: [PATCH] Fixes #5190 --- code/__HELPERS/unsorted.dm | 1 + code/modules/clothing/clothing.dm | 1 - code/modules/clothing/shoes/colour.dm | 41 ++++++++++++++++----------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 9c3b69676e3..a72591e84d4 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -550,6 +550,7 @@ Turf and target are seperate in case you want to teleport some distance from a t //Will return the location of the turf an atom is ultimatly sitting on +//isn't this just a null-reference-vulnerable copy of /proc/get_turf()? /proc/get_turf_loc(var/atom/movable/M) //gets the location of the turf that the atom is on, or what the atom is in is on, etc //in case they're in a closet or sleeper or something var/atom/loc = M.loc diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 8b04e3a18b7..8f4c4f60c07 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -172,7 +172,6 @@ BLIND // can't see anything icon = 'icons/obj/clothing/shoes.dmi' desc = "Comfortable-looking shoes." gender = PLURAL //Carn: for grammarically correct text-parsing - var/chained = 0 siemens_coefficient = 0.9 body_parts_covered = FEET slot_flags = SLOT_FEET diff --git a/code/modules/clothing/shoes/colour.dm b/code/modules/clothing/shoes/colour.dm index c689de4d00d..5fa427843c2 100644 --- a/code/modules/clothing/shoes/colour.dm +++ b/code/modules/clothing/shoes/colour.dm @@ -84,22 +84,31 @@ name = "orange shoes" icon_state = "orange" item_color = "orange" + var/chained = null + +/obj/item/clothing/shoes/orange/proc/attach_cuffs(/obj/item/weapon/handcuffs/cuffs) + if (src.chained) return + + cuffs.loc = src + src.chained = cuffs + src.slowdown = 15 + src.icon_state = "orange1" + +/obj/item/clothing/shoes/orange/proc/remove_cuffs() + if (!src.chained) return + + src.chained.loc = get_turf(src) + src.slowdown = initial(slowdown) + src.icon_state = "orange" + src.chained = null /obj/item/clothing/shoes/orange/attack_self(mob/user as mob) - if (src.chained) - src.chained = null - src.slowdown = SHOES_SLOWDOWN - new /obj/item/weapon/handcuffs( user.loc ) - src.icon_state = "orange" - return - -/obj/item/clothing/shoes/orange/attackby(H as obj, loc) ..() - if ((istype(H, /obj/item/weapon/handcuffs) && !( src.chained ))) - //H = null - if (src.icon_state != "orange") return - del(H) - src.chained = 1 - src.slowdown = 15 - src.icon_state = "orange1" - return \ No newline at end of file + remove_cuffs() + +/obj/item/clothing/shoes/orange/attackby(H as obj, mob/user as mob) + ..() + if (istype(H, /obj/item/weapon/handcuffs)) + attach_cuffs(H) + +