From caa8de05416f8149d4a354d1be17f3d46d46214f Mon Sep 17 00:00:00 2001 From: avabee <40557659+avabee@users.noreply.github.com> Date: Thu, 12 Jul 2018 15:16:09 -0500 Subject: [PATCH] Fixes a bug with integrated circuit printers. (#5407) * Fixes a bug with integrated circuit printers. This fixes a bug where tools, implants, and presumably (though i have yet to test it) device assemblies cannot be printed from the integrated circuit printer. This is a much more robust solution for the print-anything bug than the previous one, as it expands the cost to the w_class of objects in it as well as lets you print anything in the current category. (This may be an issue when two people use it at once, but I mean, just learn to take turns or something.) * closing parenthesis oops --- code/modules/integrated_electronics/core/printer.dm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index 4dfd4e989a..794755b02c 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -162,13 +162,16 @@ return 1 var/cost = 1 + + if(isnull(current_category)) + current_category = recipe_list[1] if(ispath(build_type, /obj/item/device/electronic_assembly)) var/obj/item/device/electronic_assembly/E = build_type cost = round( (initial(E.max_complexity) + initial(E.max_components) ) / 4) - else if(ispath(build_type, /obj/item/integrated_circuit)) - var/obj/item/integrated_circuit/IC = build_type - cost = initial(IC.w_class) else + var/obj/item/I = build_type + cost = initial(I.w_class) + if(!(locate(build_type) in recipe_list[current_category])) return if(metal - cost < 0) @@ -198,4 +201,4 @@ name = "integrated circuit printer upgrade disk - circuit cloner" desc = "Install this into your integrated circuit printer to enhance it. This one allows the printer to duplicate assemblies." icon_state = "upgrade_disk_clone" - origin_tech = list(TECH_ENGINEERING = 5, TECH_DATA = 6) \ No newline at end of file + origin_tech = list(TECH_ENGINEERING = 5, TECH_DATA = 6)