From dbca446d6db65a6502fac0e89f9e3ff867b74f41 Mon Sep 17 00:00:00 2001 From: Artorp Date: Sat, 28 Feb 2015 23:09:29 +0100 Subject: [PATCH] Allow paperbins to be picked up from backpacks Prevents it from being stuck in inventories --- code/modules/paperwork/paperbin.dm | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index c56de422e79..6eb42ae005d 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -25,15 +25,26 @@ amount=0 update_icon() -/obj/item/weapon/paper_bin/MouseDrop(mob/user as mob) - if((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr)))))) - if(!istype(usr, /mob/living/carbon/slime) && !istype(usr, /mob/living/simple_animal)) - if( !usr.get_active_hand() ) //if active hand is empty - src.loc = user - user.put_in_hands(src) - user.visible_message("[user] picks up the [src].", "You grab [src] from the floor!") - - return +/obj/item/weapon/paper_bin/MouseDrop(atom/over_object) + var/mob/M = usr + if(M.restrained() || M.stat || !Adjacent(M)) + return + + if(over_object == M) + M.put_in_hands(src) + + else if(istype(over_object, /obj/screen)) + switch(over_object.name) + if("r_hand") + if(!M.unEquip(src)) + return + M.put_in_r_hand(src) + if("l_hand") + if(!M.unEquip(src)) + return + M.put_in_l_hand(src) + + add_fingerprint(M) /obj/item/weapon/paper_bin/attack_paw(mob/user as mob)