Sanity check for circuit boards without build_path (#18814)

* Sanity check for circuit boards

* Adds analogous check for machine boards

Co-authored-by: Gatchapod <Gatchapod@users.noreply.github.com>
This commit is contained in:
Gatchapod
2022-08-16 22:10:34 +01:00
committed by GitHub
co-authored by Gatchapod
parent 3dfdd7483c
commit 2957e9ac85
2 changed files with 7 additions and 0 deletions
@@ -551,6 +551,10 @@
to_chat(user, "<span class='warning'>[src] does not accept circuit boards of this type!</span>")
return
if(!B.build_path)
to_chat(user, "<span class='warning'>This is not a functional computer circuit board!</span>")
return
B.play_tool_sound(src)
to_chat(user, "<span class='notice'>You place [B] inside [src].</span>")
name += " ([B.board_name])"
@@ -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, "<span class='warning'>This is not a functional machine board!</span>")
return
playsound(src.loc, B.usesound, 50, 1)
to_chat(user, "<span class='notice'>You add the circuit board to the frame.</span>")
circuit = P