Update code/game/objects/items/storage/firstaid.dm
Co-authored-by: silicons <2003111+silicons@users.noreply.github.com>
This commit is contained in:
@@ -232,12 +232,17 @@
|
|||||||
/obj/item/storage/pill_bottle/AltClick(mob/living/carbon/user)
|
/obj/item/storage/pill_bottle/AltClick(mob/living/carbon/user)
|
||||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||||
return
|
return
|
||||||
var/obj/item/reagent_containers/pill/W = locate(/obj/item/reagent_containers/pill) in contents
|
if(!length(user.get_empty_held_indexes()))
|
||||||
if(W && contents.len > 0)
|
to_chat(user, "<span class='warning'>Your hands are full!</span>")
|
||||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user)
|
return
|
||||||
user.put_in_hands(W)
|
var/obj/item/reagent_containers/pill/P = locate() in contents
|
||||||
contents -= W
|
if(P)
|
||||||
to_chat(user, "<span class='notice'>You pop \a [W] out of the bottle.</span>")
|
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, P, user)
|
||||||
|
if(!user.put_in_hands(P))
|
||||||
|
P.forceMove(user.drop_location()) // make sure it's not stuck in the user if the put in hands somehow fails
|
||||||
|
to_chat(user, "<span class='notice'>You take \a [P] out of [src].</span>")
|
||||||
|
else
|
||||||
|
to_chat(user, "<span class='warning'>[P] drops to the floor!</span>")
|
||||||
else
|
else
|
||||||
to_chat(user, "<span class='notice'>There are no pills left in the bottle.</span>")
|
to_chat(user, "<span class='notice'>There are no pills left in the bottle.</span>")
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|||||||
Reference in New Issue
Block a user