From 010aec7f5049c6352435fdaa0beab2a747c992e6 Mon Sep 17 00:00:00 2001 From: dj-34 Date: Sat, 27 Jan 2024 00:23:20 +0500 Subject: [PATCH] Fix stacks dupe and ore duping with BS crystals (#23948) --- code/game/objects/items/stacks/stack.dm | 2 ++ code/modules/mining/machine_redemption.dm | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 11d45ad6448..9a4586be816 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -351,6 +351,8 @@ var/stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack? (Maximum: [max])") as null|num) if(stackmaterial == null || stackmaterial <= min || stackmaterial > get_amount()) return + if(!Adjacent(user, 1)) + return change_stack(user,stackmaterial) to_chat(user, "You take [stackmaterial] sheets out of the stack.") diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 33ea40ed412..746107d96a7 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -396,7 +396,11 @@ var/datum/component/material_container/materials = GetComponent(/datum/component/material_container) var/amount_compatible = materials.get_item_material_amount(O) if(amount_compatible) - materials.insert_item(O, sheet_per_ore) + // Prevents duping + if(O.refined_type) + materials.insert_item(O, sheet_per_ore) + else + materials.insert_item(O, 1) // Delete the stack ore_buffer -= O qdel(O)