mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 20:15:47 +01:00
Stacker to silo fix (#51852)
About The Pull Request Currently when the stacker picks up an item it is stored in the stacker console and creats a log in the silo that 0 amount was added to the silo. This is in contrast to when you slap the stacker with a stack, it will go to the silo and not the stacker console. This makes it so that all items that are picked up will go to the connected silo, just like slapping it would. The gulag points are properly calculated and save to the point console for both methods. Fixes #48587 Why It's Good For The Game Stacker works as expected when it picks up stacks. Changelog 🆑 fix: Stackers deposit to the silo when picking up stacks from the input side. /🆑
This commit is contained in:
@@ -109,6 +109,17 @@
|
||||
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
|
||||
if(QDELETED(inp))
|
||||
return
|
||||
|
||||
// Dump the sheets to the silo if attached
|
||||
if(materials.silo && !materials.on_hold())
|
||||
var/matlist = inp.custom_materials & materials.mat_container.materials
|
||||
if (length(matlist))
|
||||
var/inserted = materials.mat_container.insert_item(inp)
|
||||
materials.silo_log(src, "collected", inserted, "sheets", matlist)
|
||||
qdel(inp)
|
||||
return
|
||||
|
||||
// No silo attached process to internal storage
|
||||
var/key = inp.merge_type
|
||||
var/obj/item/stack/sheet/storage = stack_list[key]
|
||||
if(!storage) //It's the first of this sheet added
|
||||
@@ -116,15 +127,6 @@
|
||||
storage.amount += inp.amount //Stack the sheets
|
||||
qdel(inp)
|
||||
|
||||
if(materials.silo && !materials.on_hold()) //Dump the sheets to the silo
|
||||
var/matlist = storage.custom_materials & materials.mat_container.materials
|
||||
if (length(matlist))
|
||||
var/inserted = materials.mat_container.insert_item(storage)
|
||||
materials.silo_log(src, "collected", inserted, "sheets", matlist)
|
||||
if (QDELETED(storage))
|
||||
stack_list -= key
|
||||
return
|
||||
|
||||
while(storage.amount >= stack_amt) //Get rid of excessive stackage
|
||||
var/obj/item/stack/sheet/out = new inp.type(null, stack_amt)
|
||||
unload_mineral(out)
|
||||
|
||||
Reference in New Issue
Block a user