mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
gia ;_;
This commit is contained in:
@@ -47,8 +47,7 @@
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
out.amount = inp.amount
|
||||
inp.amount = 0
|
||||
out.loc = machine.output.loc
|
||||
|
||||
machine.unload_mineral(out)
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -66,30 +65,10 @@
|
||||
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
|
||||
var/stk_types = list()
|
||||
var/stk_amt = list()
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/stack_list[0] //Key: Type. Value: Instance of type.
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
if(!istype(output) || !istype(input))
|
||||
del(src)
|
||||
return
|
||||
processing_objects.Add(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
|
||||
if(!istype(inp)) //Non-sheets. Yuck.
|
||||
return
|
||||
if(!(inp.type in stack_list)) //It's the first of this sheet added
|
||||
var/obj/item/stack/sheet/s = new inp.type(src,0)
|
||||
s.amount = 0
|
||||
@@ -100,14 +79,11 @@
|
||||
while(storage.amount > stack_amt) //Get rid of excessive stackage
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
out.amount = stack_amt
|
||||
out.loc = output.loc
|
||||
unload_mineral(out)
|
||||
storage.amount -= stack_amt
|
||||
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/process()
|
||||
var/obj/item/stack/sheet/O
|
||||
while (locate(/obj/item/stack/sheet, input.loc))
|
||||
O = locate(/obj/item/stack/sheet, input.loc)
|
||||
if(istype(O,/obj/item/stack/sheet))
|
||||
process_sheet(O)
|
||||
return
|
||||
var/turf/T = get_step(src, dir)
|
||||
if(T)
|
||||
for(var/obj/item/stack/sheet/S in T)
|
||||
process_sheet(S)
|
||||
|
||||
Reference in New Issue
Block a user