From 2940f0efa5ef891cc076776ce80fcc4e6cd100fe Mon Sep 17 00:00:00 2001 From: Chiirno <43803700+Chiirno@users.noreply.github.com> Date: Fri, 10 Jul 2020 02:35:42 -0400 Subject: [PATCH] Update code/game/objects/items/storage/firstaid.dm Co-authored-by: silicons <2003111+silicons@users.noreply.github.com> --- code/game/objects/items/storage/firstaid.dm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/storage/firstaid.dm b/code/game/objects/items/storage/firstaid.dm index 7deda5da27..34c1a6b280 100644 --- a/code/game/objects/items/storage/firstaid.dm +++ b/code/game/objects/items/storage/firstaid.dm @@ -232,12 +232,17 @@ /obj/item/storage/pill_bottle/AltClick(mob/living/carbon/user) if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) return - var/obj/item/reagent_containers/pill/W = locate(/obj/item/reagent_containers/pill) in contents - if(W && contents.len > 0) - SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user) - user.put_in_hands(W) - contents -= W - to_chat(user, "You pop \a [W] out of the bottle.") + if(!length(user.get_empty_held_indexes())) + to_chat(user, "Your hands are full!") + return + var/obj/item/reagent_containers/pill/P = locate() in contents + if(P) + 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, "You take \a [P] out of [src].") + else + to_chat(user, "[P] drops to the floor!") else to_chat(user, "There are no pills left in the bottle.") return TRUE