From 1c84c36b7e4bc39526527c8b6e912d8d5d9f7f57 Mon Sep 17 00:00:00 2001 From: Vladisvell <73733747+Vladisvell@users.noreply.github.com> Date: Sun, 29 Oct 2023 22:18:22 +0500 Subject: [PATCH] bugfix: fixed resource exploit for ore redemption (#3796) --- code/modules/mining/machine_redemption.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index d1f5d63275e..d808dbf2beb 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -332,12 +332,14 @@ return FALSE var/stored = get_num_smeltable_alloy(D) var/desired = min(amount, stored, MAX_STACK_SIZE) + if(!desired) + return FALSE materials.use_amount(D.materials, desired) // Spawn the alloy var/result = new D.build_path(src) if(istype(result, /obj/item/stack)) var/obj/item/stack/A = result - A.amount = amount + A.amount = desired unload_mineral(A) else unload_mineral(result)