From f39068ba1d8c62bdfef2c327420aefc67d1a40b7 Mon Sep 17 00:00:00 2001 From: Casper3667 <8396443+Casper3667@users.noreply.github.com> Date: Mon, 20 Apr 2026 13:31:55 +0200 Subject: [PATCH] Fixes some sheet snatcher material bugs (#22280) This fixes dumping the contents of the sheet snatcher would make the mat stacks look like they only had 1 item. It also fixes so picking up material/steel will merge with material/steel/full. And fixes that the quick pickup method did not merge item stacks. --- code/game/objects/items/weapons/storage/bags.dm | 16 +++++++++++++++- html/changelogs/SnatcherBag.yml | 7 +++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/SnatcherBag.yml diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 4fa6e489648..d0ae3b1994a 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -162,6 +162,19 @@ return 0 return 1 +// This is pretty much a copy of it, but sends it to handle_item_insertion instead. +/obj/item/storage/bag/sheetsnatcher/handle_item_insertion_deferred(obj/item/W, mob/user) + if (!istype(W)) + return FALSE + + if (user) + user.prepare_for_slotmove(W) + + if (user) + W.dropped(user) + + handle_item_insertion(W) + // Modified handle_item_insertion. Would prefer not to, but... /obj/item/storage/bag/sheetsnatcher/handle_item_insertion(obj/item/W as obj, prevent_warning = 0) @@ -179,7 +192,7 @@ amount = S.amount for(var/obj/item/stack/material/sheet in contents) - if(S.type == sheet.type) // we are violating the amount limitation because these are not sane objects + if(S.material == sheet.material) // we are violating the amount limitation because these are not sane objects sheet.amount += amount // they should only be removed through procs in this file, which split them up. S.amount -= amount inserted = 1 @@ -236,6 +249,7 @@ var/stacksize = min(S.amount,N.max_amount) N.amount = stacksize S.amount -= stacksize + N.update_icon() if(!S.amount) qdel(S) // todo: there's probably something missing here orient2hud(usr) diff --git a/html/changelogs/SnatcherBag.yml b/html/changelogs/SnatcherBag.yml new file mode 100644 index 00000000000..ca5833f4f94 --- /dev/null +++ b/html/changelogs/SnatcherBag.yml @@ -0,0 +1,7 @@ +author: TheGreyWolf + +delete-after: True + +changes: + - bugfix: "Fixes stacking materials in the sheet snatcher." + - bugfix: "Fixes emptying sheet snatchers made material stacks look like they only had 1 item in them."