From 1120fb50c93692ba56f1112a54b86e3f4aa0c741 Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Sun, 29 Jul 2012 07:19:53 +0000 Subject: [PATCH] put_in_hands() now makes objects behave like they were just dropped when it dumps them on the floor due to there being no free hand to put it in. (i.e. it calls object.dropped() and resets the layer.) Fixes issue 699 - in-hands for pipes are removed when placing a pipe back in the dispenser. Fixes issue 684 - Evidence bag code simplified a bit. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4213 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/machinery/pipe/pipe_dispenser.dm | 1 + code/modules/detectivework/evidence.dm | 26 ++++++++++------------ code/modules/mob/inventory.dm | 2 ++ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index ffa80ec1583..b58a32988e5 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -71,6 +71,7 @@ src.add_fingerprint(usr) if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter)) usr << "\blue You put [W] back to [src]." + user.drop_item() del(W) return else if (istype(W, /obj/item/weapon/wrench)) diff --git a/code/modules/detectivework/evidence.dm b/code/modules/detectivework/evidence.dm index 164265e428c..7326f35ba23 100644 --- a/code/modules/detectivework/evidence.dm +++ b/code/modules/detectivework/evidence.dm @@ -11,35 +11,33 @@ if(!in_range(O,user)) return - if(istype(O, /obj/item/weapon/storage) && O in user) + if(istype(O, /obj/item/weapon/storage)) return ..() - if(!(O && istype(O)) || O.anchored == 1) - user << "You can't put that inside \the [src]!" + if(!istype(O) || O.anchored == 1) + user << "You can't put that inside \the [src]!" return ..() if(istype(O, /obj/item/weapon/evidencebag)) - user << "You find putting an evidence bag in another evidence bag to be slightly absurd." + user << "You find putting an evidence bag in another evidence bag to be slightly absurd." return if(contents.len) - user << "The [src] already has something inside it." + user << "\The [src] already has something inside it." return ..() - if(O in user) //If it is in their inventory, but not in their hands, don't grab it off of them. - if(user.l_hand == O) + if(!isturf(O.loc)) //If it isn't on the floor. Do some checks to see if it's in our hands or a box. Otherwise give up. + if(istype(O.loc,/obj/item/weapon/storage)) //in a container. + var/obj/item/weapon/storage/U = O.loc + user.client.screen -= O + U.contents.Remove(O) + else if(user.l_hand == O) //in a hand user.drop_l_hand() - else if(user.r_hand == O) + else if(user.r_hand == O) //in a hand user.drop_r_hand() else - user << "You are wearing that." return - else if(istype(O.loc,/obj/item/weapon/storage)) - var/obj/item/weapon/storage/U = O.loc - user.client.screen -= O - U.contents.Remove(O) - user.visible_message("\The [user] puts \a [O] into \a [src]", "You put \the [O] inside \the [src].",\ "You hear a rustle as someone puts something into a plastic bag.") icon_state = "evidence" diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 804a969b50b..051fc498ad3 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -61,6 +61,8 @@ else if(put_in_inactive_hand(W)) return 1 else W.loc = get_turf(src) + W.layer = initial(W.layer) + W.dropped() return 0