From 2957e9ac857ffc90ef5a15fff6b35709172cfdb4 Mon Sep 17 00:00:00 2001 From: Gatchapod <20936555+Gatchapod@users.noreply.github.com> Date: Tue, 16 Aug 2022 23:10:34 +0200 Subject: [PATCH] Sanity check for circuit boards without build_path (#18814) * Sanity check for circuit boards * Adds analogous check for machine boards Co-authored-by: Gatchapod --- code/game/machinery/computer/buildandrepair.dm | 4 ++++ code/game/machinery/constructable_frame.dm | 3 +++ 2 files changed, 7 insertions(+) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 1f13887af46..94625961bc7 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -551,6 +551,10 @@ to_chat(user, "[src] does not accept circuit boards of this type!") return + if(!B.build_path) + to_chat(user, "This is not a functional computer circuit board!") + return + B.play_tool_sound(src) to_chat(user, "You place [B] inside [src].") name += " ([B.board_name])" diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 3159cec72a0..43208497026 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -99,6 +99,9 @@ if(istype(P, /obj/item/circuitboard)) var/obj/item/circuitboard/B = P if(B.board_type == "machine") + if(!B.build_path) + to_chat(user, "This is not a functional machine board!") + return playsound(src.loc, B.usesound, 50, 1) to_chat(user, "You add the circuit board to the frame.") circuit = P