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
This commit is contained in:
elly1989@rocketmail.com
2012-07-29 07:19:53 +00:00
parent 8d500dfdf0
commit 1120fb50c9
3 changed files with 15 additions and 14 deletions

View File

@@ -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))

View File

@@ -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 << "<span class='notice'>You can't put that inside \the [src]!</span>"
return ..()
if(istype(O, /obj/item/weapon/evidencebag))
user << "You find putting an evidence bag in another evidence bag to be slightly absurd."
user << "<span class='notice'>You find putting an evidence bag in another evidence bag to be slightly absurd.</span>"
return
if(contents.len)
user << "The [src] already has something inside it."
user << "<span class='notice'>\The [src] already has something inside it.</span>"
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"

View File

@@ -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