From f9f9214e809e8c8727f418fe037cdb71a7e7a21c Mon Sep 17 00:00:00 2001 From: nicetoolbox Date: Sun, 11 Oct 2020 14:03:06 -0700 Subject: [PATCH] Add can_copy_design to restrict designs you can copy to disk to autolathe designs and protolathe designs that only use metal and/or glass --- code/modules/research/rdconsole.dm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 884f3004a2e..da10dbfe558 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -566,7 +566,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, if("copy_design") //Copy design data from the research holder to the design disk. // This href ALSO makes me very nervous var/datum/design/design = files.known_designs[params["id"]] - if(design && d_disk) + if(design && d_disk && can_copy_design(design)) d_disk.blueprint = design menu = MENU_DISK submenu = SUBMENU_MAIN @@ -778,6 +778,19 @@ won't update every console in existence) but it's more of a hassle to do. Also, loaded_chemical["id"] = R.id +/obj/machinery/computer/rdconsole/proc/can_copy_design(datum/design/D) + if(D) + if(D.build_type & AUTOLATHE) + return TRUE + + if(D.build_type & PROTOLATHE) + for(var/M in D.materials) + if(M != MAT_METAL && M != MAT_GLASS) + return FALSE + return TRUE + + return FALSE + /obj/machinery/computer/rdconsole/tgui_data(mob/user) var/list/data = list() @@ -860,6 +873,8 @@ won't update every console in existence) but it's more of a hassle to do. Also, data["to_copy"] = to_copy for(var/v in files.known_designs) var/datum/design/D = files.known_designs[v] + if(!can_copy_design(D)) + continue var/list/item = list() to_copy[++to_copy.len] = item item["name"] = D.name