[MIRROR] Adds the CIRCUIT_FLAG_REFUSE_MODULE circuit flag. [MDB IGNORE] (#8763)

* Adds the CIRCUIT_FLAG_REFUSE_MODULE circuit flag. (#62033)

Components like the MMI one can't be added to circuits more than once since they may register signals with same proctype and similar things which make for some tangled up race conditions if more than one is present.
Unfortunately this safety can be bypassed - with little gain alas, an MMI can't be inserted by attacking the component with it. it needs a shell - by using a module component. That's no good. So I'm adding a flag that can be used to stop certain components from being added to module components.

* Adds the CIRCUIT_FLAG_REFUSE_MODULE circuit flag.

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-10-12 01:45:54 +01:00
committed by GitHub
co-authored by Ghom
parent 8ba1369217
commit 80b535b1ff
4 changed files with 11 additions and 1 deletions
+5 -1
View File
@@ -82,7 +82,6 @@
if(circuit_flags & CIRCUIT_FLAG_INSTANT)
ui_color = "orange"
/obj/item/circuit_component/Destroy()
if(parent)
// Prevents a Destroy() recursion
@@ -97,6 +96,11 @@
QDEL_LIST(input_ports)
return ..()
/obj/item/circuit_component/examine(mob/user)
. = ..()
if(circuit_flags & CIRCUIT_FLAG_REFUSE_MODULE)
. += span_notice("It's incompatible with module components.")
/**
* Called when a shell is registered from the component/the component is added to a circuit.
*