Techfabs print 5x cable coil (#84067)

## About The Pull Request
- Fixes #84050

## Changelog
🆑
fix: Techfabs now print 5x cable coil
/🆑
This commit is contained in:
SyncIt21
2024-06-19 23:54:33 +05:30
committed by GitHub
parent 8c0ed6c474
commit 4662a06571

View File

@@ -411,14 +411,25 @@
var/atom/movable/created
if(is_stack)
created = new design.build_path(target, items_remaining)
var/obj/item/stack/stack_item = initial(design.build_path)
var/max_stack_amount = initial(stack_item.max_amount)
var/number_to_make = (initial(stack_item.amount) * items_remaining)
while(number_to_make > max_stack_amount)
created = new stack_item(null, max_stack_amount) //it's imporant to spawn things in nullspace, since obj's like stacks qdel when they enter a tile/merge with other stacks of the same type, resulting in runtimes.
created.pixel_x = created.base_pixel_x + rand(-6, 6)
created.pixel_y = created.base_pixel_y + rand(-6, 6)
created.forceMove(target)
number_to_make -= max_stack_amount
created = new stack_item(null, number_to_make)
else
created = new design.build_path(target)
created = new design.build_path(null)
split_materials_uniformly(design_materials, material_cost_coefficient, created)
created.pixel_x = created.base_pixel_x + rand(-6, 6)
created.pixel_y = created.base_pixel_y + rand(-6, 6)
SSblackbox.record_feedback("nested tally", "lathe_printed_items", 1, list("[type]", "[created.type]"))
created.forceMove(target)
if(is_stack)
items_remaining = 0