From 7fa1e6a9f59c41703496ed22c8d498dbe6f46fde Mon Sep 17 00:00:00 2001 From: Happyowl93 <231794227+Happyowl93@users.noreply.github.com> Date: Wed, 13 May 2026 09:14:22 +0200 Subject: [PATCH] fixes resource duplication bug with material floor tiles (#95973) ## About The Pull Request Fixes https://github.com/tgstation/tgstation/issues/95962. Applies a scaling to the resulting items mats_per_unit of a stack so, each item in the stack has the correct material value. Tested locally, now each material floor tile only gives 1/4 of a sheet ## Why It's Good For The Game Bugfix. ## Changelog :cl: fix: fixes material floor duplication /:cl: Co-authored-by: pepe --- code/game/objects/items/stacks/stack.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 11f5de5190b..8d617c29117 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -475,8 +475,12 @@ if(isstack(created)) var/obj/item/stack/crafted_stack = created + if(recipe.res_amount > 0 && recipe.req_amount != recipe.res_amount) + var/scale = recipe.req_amount / recipe.res_amount + for(var/mat in result_mats) + result_mats[mat] *= scale crafted_stack.mats_per_unit = SSmaterials.get_material_set_cache(result_mats) - update_custom_materials() + crafted_stack.update_custom_materials() else created.set_custom_materials(result_mats, recipe.req_amount * multiplier)