diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 4468cc6ebee..403d2c70aaf 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -368,7 +368,7 @@
var/sortTag = 0
var/sealed = 0
-/obj/item/shippingPackage/attackby(obj/O, mob/user, params)
+/obj/item/shippingPackage/attackby(obj/item/O, mob/user, params)
if(sealed)
if(istype(O, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(user,"Intended recipient?","Address","")),1,MAX_NAME_LEN)
@@ -382,16 +382,18 @@
to_chat(user, "[src] already contains \a [wrapped].")
return
if(istype(O, /obj/item) && !istype(O, /obj/item/weapon/storage) && !istype(O, /obj/item/shippingPackage))
- var/obj/item/I = O
- if(I.w_class > 3)
- to_chat(user, "[I] is too large to fit in [src].")
+ if(!user.canUnEquip(O))
+ to_chat(user, "[O] is stuck to your hand, you cannot put it in [src]!")
+ return
+ if(O.w_class > 3)
+ to_chat(user, "[O] is too large to fit in [src].")
else
- wrapped = I
- user.unEquip(I)
- I.forceMove(src)
- I.add_fingerprint(usr)
+ wrapped = O
+ user.unEquip(O)
+ O.forceMove(src)
+ O.add_fingerprint(usr)
add_fingerprint(usr)
- to_chat(user, "You put [I] in [src].")
+ to_chat(user, "You put [O] in [src].")
/obj/item/shippingPackage/attack_self(mob/user)
if(sealed)
@@ -424,4 +426,10 @@
if(sortTag)
desc += " The label says \"Deliver to [TAGGERLOCATIONS[sortTag]]\"."
if(!sealed)
- desc += " The package is not sealed."
\ No newline at end of file
+ desc += " The package is not sealed."
+
+/obj/item/shippingPackage/Destroy()
+ if(wrapped)
+ qdel(wrapped)
+ wrapped = null
+ return ..()
\ No newline at end of file