mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
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:
@@ -71,6 +71,7 @@
|
|||||||
src.add_fingerprint(usr)
|
src.add_fingerprint(usr)
|
||||||
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
|
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
|
||||||
usr << "\blue You put [W] back to [src]."
|
usr << "\blue You put [W] back to [src]."
|
||||||
|
user.drop_item()
|
||||||
del(W)
|
del(W)
|
||||||
return
|
return
|
||||||
else if (istype(W, /obj/item/weapon/wrench))
|
else if (istype(W, /obj/item/weapon/wrench))
|
||||||
|
|||||||
@@ -11,35 +11,33 @@
|
|||||||
if(!in_range(O,user))
|
if(!in_range(O,user))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(istype(O, /obj/item/weapon/storage) && O in user)
|
if(istype(O, /obj/item/weapon/storage))
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
if(!(O && istype(O)) || O.anchored == 1)
|
if(!istype(O) || O.anchored == 1)
|
||||||
user << "You can't put that inside \the [src]!"
|
user << "<span class='notice'>You can't put that inside \the [src]!</span>"
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
if(istype(O, /obj/item/weapon/evidencebag))
|
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
|
return
|
||||||
|
|
||||||
if(contents.len)
|
if(contents.len)
|
||||||
user << "The [src] already has something inside it."
|
user << "<span class='notice'>\The [src] already has something inside it.</span>"
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
if(O in user) //If it is in their inventory, but not in their hands, don't grab it off of them.
|
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(user.l_hand == O)
|
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()
|
user.drop_l_hand()
|
||||||
else if(user.r_hand == O)
|
else if(user.r_hand == O) //in a hand
|
||||||
user.drop_r_hand()
|
user.drop_r_hand()
|
||||||
else
|
else
|
||||||
user << "You are wearing that."
|
|
||||||
return
|
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].",\
|
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.")
|
"You hear a rustle as someone puts something into a plastic bag.")
|
||||||
icon_state = "evidence"
|
icon_state = "evidence"
|
||||||
|
|||||||
@@ -61,6 +61,8 @@
|
|||||||
else if(put_in_inactive_hand(W)) return 1
|
else if(put_in_inactive_hand(W)) return 1
|
||||||
else
|
else
|
||||||
W.loc = get_turf(src)
|
W.loc = get_turf(src)
|
||||||
|
W.layer = initial(W.layer)
|
||||||
|
W.dropped()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user