mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
Merge pull request #9874 from VOREStation/upstream-merge-7948
[MIRROR] Fix stacking machine not stacking most materials
This commit is contained in:
committed by
Chompstation Bot
parent
f38596b023
commit
0109cb82c3
@@ -87,18 +87,11 @@
|
|||||||
/obj/machinery/mineral/stacking_machine/New()
|
/obj/machinery/mineral/stacking_machine/New()
|
||||||
..()
|
..()
|
||||||
|
|
||||||
for(var/stacktype in subtypesof(/obj/item/stack/material))
|
for(var/stacktype in (subtypesof(/obj/item/stack/material) - typesof(/obj/item/stack/material/cyborg)))
|
||||||
var/obj/item/stack/S = stacktype
|
var/obj/item/stack/material/S = stacktype
|
||||||
var/s_name = initial(S.name)
|
var/s_matname = initial(S.default_type)
|
||||||
stack_storage[s_name] = 0
|
stack_storage[s_matname] = 0
|
||||||
stack_paths[s_name] = stacktype
|
stack_paths[s_matname] = stacktype
|
||||||
|
|
||||||
stack_storage["glass"] = 0
|
|
||||||
stack_paths["glass"] = /obj/item/stack/material/glass
|
|
||||||
stack_storage[DEFAULT_WALL_MATERIAL] = 0
|
|
||||||
stack_paths[DEFAULT_WALL_MATERIAL] = /obj/item/stack/material/steel
|
|
||||||
stack_storage["plasteel"] = 0
|
|
||||||
stack_paths["plasteel"] = /obj/item/stack/material/plasteel
|
|
||||||
|
|
||||||
spawn( 5 )
|
spawn( 5 )
|
||||||
for (var/dir in cardinal)
|
for (var/dir in cardinal)
|
||||||
@@ -127,10 +120,12 @@
|
|||||||
var/turf/T = get_turf(input)
|
var/turf/T = get_turf(input)
|
||||||
for(var/obj/item/O in T.contents)
|
for(var/obj/item/O in T.contents)
|
||||||
if(!O) return
|
if(!O) return
|
||||||
if(istype(O,/obj/item/stack))
|
if(istype(O,/obj/item/stack/material))
|
||||||
if(!isnull(stack_storage[O.name]))
|
var/obj/item/stack/material/S = O
|
||||||
stack_storage[O.name]++
|
var/matname = S.material.name
|
||||||
O.loc = null
|
if(!isnull(stack_storage[matname]))
|
||||||
|
stack_storage[matname] += S.amount
|
||||||
|
qdel(S)
|
||||||
else
|
else
|
||||||
O.loc = output.loc
|
O.loc = output.loc
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user