Fixes a couple more bugs with the sheet snatcher (#22348)

Mostly in relation to it showing the incorrect amount in certain
circumstances.
This commit is contained in:
Casper3667
2026-04-26 10:55:40 +00:00
committed by GitHub
parent baae487e27
commit 3f63ade08a
2 changed files with 14 additions and 8 deletions
@@ -195,7 +195,8 @@
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
sheet.update_icon()
inserted = TRUE
break
if(!inserted || !S.amount)
@@ -213,7 +214,7 @@
if(usr.s_active)
usr.s_active.show_to(usr)
update_icon()
return 1
return TRUE
// Sets up numbered display to show the stack size of each stored mineral
@@ -239,17 +240,14 @@
src.slot_orient_objs(row_num, col_count, numbered_contents)
return
// Modified quick_empty verb drops appropriate sized stacks
/obj/item/storage/bag/sheetsnatcher/quick_empty()
var/location = get_turf(src)
for(var/obj/item/stack/material/S in contents)
while(S.amount)
var/obj/item/stack/material/N = new S.type(location)
var/stacksize = min(S.amount,N.max_amount)
N.amount = stacksize
var/stacksize = min(S.amount,S.max_amount)
new S.stacktype(location, stacksize)
S.amount -= stacksize
N.update_icon()
if(!S.amount)
qdel(S) // todo: there's probably something missing here
orient2hud(usr)
@@ -268,9 +266,11 @@
// -Sayu
if(S.amount > S.max_amount)
var/obj/item/stack/material/temp = new S.type(src)
var/obj/item/stack/material/temp = new S.stacktype(src)
temp.amount = S.amount - S.max_amount
S.amount = S.max_amount
S.update_icon()
temp.update_icon()
return ..(S,new_location)