From d1d0effa0a916f4db63e7f2494229662af3a1025 Mon Sep 17 00:00:00 2001
From: 1080pCat <96908085+1080pCat@users.noreply.github.com>
Date: Thu, 17 Aug 2023 05:31:04 +1000
Subject: [PATCH] Empty trashbags can now fit inside backpacks. (#21888)
* i think this is workin
* sillly me
* also this guh
---
.../objects/items/weapons/storage/bags.dm | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index ef2d2260121..705908d9a78 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -42,6 +42,31 @@
can_hold = list() // any
cant_hold = list(/obj/item/disk/nuclear)
+/obj/item/storage/bag/trash/proc/update_weight()
+ if(!length(contents))
+ w_class = WEIGHT_CLASS_NORMAL
+ return
+
+ w_class = WEIGHT_CLASS_BULKY
+
+/obj/item/storage/bag/trash/remove_from_storage(obj/item/I, atom/new_location)
+ . = ..()
+ update_weight()
+
+/obj/item/storage/bag/trash/can_be_inserted(obj/item/I, stop_messages = FALSE)
+ if(isstorage(loc) && !istype(loc, /obj/item/storage/backpack/holding))
+ to_chat(usr, "You can't seem to fit [I] into [src].")
+ return FALSE
+ . = ..()
+
+/obj/item/storage/bag/trash/Initialize(mapload)
+ . = ..()
+ update_weight()
+
+/obj/item/storage/bag/trash/handle_item_insertion(obj/item/I, prevent_warning)
+ . = ..()
+ update_weight()
+
/obj/item/storage/bag/trash/suicide_act(mob/user)
user.visible_message("[user] puts [src] over [user.p_their()] head and starts chomping at the insides! Disgusting!")
playsound(loc, 'sound/items/eatfood.ogg', 50, 1, -1)