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.
This commit is contained in:
Ghom
2021-10-11 19:28:08 +01:00
committed by GitHub
parent d7870d975a
commit b78b9fde74
4 changed files with 11 additions and 1 deletions
@@ -47,6 +47,9 @@
return ..()
/obj/item/integrated_circuit/module/add_component(obj/item/circuit_component/to_add, mob/living/user)
if(to_add.circuit_flags & CIRCUIT_FLAG_REFUSE_MODULE)
balloon_alert(user, "doesn't fit into module!")
return
. = ..()
if(attached_module)
attached_module.circuit_size += to_add.circuit_size
@@ -6,6 +6,7 @@
/obj/item/circuit_component/mmi
display_name = "Man-Machine Interface"
desc = "A component that allows MMI to enter shells to send output signals."
circuit_flags = CIRCUIT_FLAG_REFUSE_MODULE
/// The message to send to the MMI in the shell.
var/datum/port/input/message