From 53399ff87f14496133cb82528a8b7576fd97aaf6 Mon Sep 17 00:00:00 2001 From: Adrer Date: Wed, 31 Mar 2021 20:46:15 +0200 Subject: [PATCH] Make RND machines check for upgraded parts when checking if an item is constructable (#15753) * Protolathe design buildability check efficiency * Efficiency_coeff rounding error fix Co-authored-by: adrermail@gmail.com --- code/modules/research/protolathe.dm | 10 +++++----- code/modules/research/rdconsole.dm | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 485039c56b7..44fa7e00e1b 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -63,18 +63,18 @@ Note: Must be placed west/left of and R&D console to function. for(var/obj/item/stock_parts/matter_bin/M in component_parts) T += M.rating materials.max_amount = T * 75000 - T = 1.2 + T = 12 for(var/obj/item/stock_parts/manipulator/M in component_parts) - T -= M.rating/10 - efficiency_coeff = min(max(0, T), 1) + T -= M.rating + efficiency_coeff = min(max(0, T / 10), 1) /obj/machinery/r_n_d/protolathe/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material var/A = materials.amount(M) if(!A) A = reagents.get_reagent_amount(M) - A = A / max(1, (being_built.reagents_list[M])) + A = A / max(1, (being_built.reagents_list[M] * efficiency_coeff)) else - A = A / max(1, (being_built.materials[M])) + A = A / max(1, (being_built.materials[M] * efficiency_coeff)) return A /obj/machinery/r_n_d/protolathe/attackby(obj/item/O as obj, mob/user as mob, params) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 7d146e08feb..da21ae77d78 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -427,7 +427,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, var/enough_materials = TRUE - if(!machine.materials.has_materials(efficient_mats, amount)) + if(!machine.materials.has_materials(being_built.materials, coeff)) atom_say("Not enough materials to complete prototype.") enough_materials = FALSE else