From e9e8cd31fe41d25c347e8ed6ba0836b86f8ece0c Mon Sep 17 00:00:00 2001 From: Maximal08 <73069825+Maximal08@users.noreply.github.com> Date: Mon, 11 Aug 2025 11:28:18 +0500 Subject: [PATCH] manufacturing lathe now prints items according to their quantity in the autolathe (#92439) ## About The Pull Request manufacturing lathe now prints items according to their quantity in the autolathe https://github.com/user-attachments/assets/c63764ff-08e1-410e-892f-0aa7539ff317 ## Why It's Good For The Game manufacturing lattice did not take into account the number of printed items at a time, which is why, for example, it produced 1 wire at a price of 5 ## Changelog :cl: fix: manufacturing lathe now prints items according to their quantity in the autolathe /:cl: --- code/modules/manufactorio/machines/lathe.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/modules/manufactorio/machines/lathe.dm b/code/modules/manufactorio/machines/lathe.dm index 351e5c25030..d2a4e65f677 100644 --- a/code/modules/manufactorio/machines/lathe.dm +++ b/code/modules/manufactorio/machines/lathe.dm @@ -143,7 +143,14 @@ var/atom/movable/created if(is_stack) var/obj/item/stack/stack_item = initial(design.build_path) - created = new stack_item(null, 1) + var/max_stack_amount = initial(stack_item.max_amount) + var/amount = initial(stack_item.amount) + while(amount > max_stack_amount) + var/obj/item/stack/new_stack = new stack_item(null, max_stack_amount) + if(!send_resource(new_stack, dir)) + withheld = new_stack + amount -= max_stack_amount + created = new stack_item(null, amount) else created = new design.build_path(null) split_materials_uniformly(materials_needed, target_object = created) @@ -155,7 +162,6 @@ if(!send_resource(created, dir)) withheld = created - /obj/machinery/power/manufacturing/lathe/proc/finalize_build() print_sound.stop() deltimer(busy)