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.
This commit is contained in:
Casper3667
2026-04-20 11:31:55 +00:00
committed by GitHub
parent b18442c14c
commit f39068ba1d
2 changed files with 22 additions and 1 deletions
@@ -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)