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
This commit is contained in:
avabee
2018-07-12 15:16:09 -05:00
committed by VirgoBot
parent 6b0c8361e9
commit caa8de0541

View File

@@ -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)