mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 23:14:18 +01:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user