[MIRROR] Improves proccall admin circuit component. Adds the option to not resolve weakrefs for set variables and proccall admin circuit components. [MDB IGNORE] (#11471)

* Improves proccall admin circuit component. Adds the option to not resolve weakrefs for set variables and proccall admin circuit components. (#64564)

* Improves proccall admin circuit function

* Improves proccall admin circuit component. Adds the option to not resolve weakrefs for set variables and proccall admin circuit components.

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-02-12 22:10:10 +01:00
committed by GitHub
parent 5163ba307b
commit fa4a85b41a
3 changed files with 276 additions and 17 deletions
@@ -9,6 +9,9 @@
category = "Admin"
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL|CIRCUIT_FLAG_ADMIN
/// Whether to resolve weakrefs or not
var/datum/port/input/resolve_weakrefs
/// Entity to set variable of
var/datum/port/input/entity
@@ -20,6 +23,7 @@
/obj/item/circuit_component/set_variable/populate_ports()
resolve_weakrefs = add_input_port("Resolve Weakrefs", PORT_TYPE_NUMBER, default = TRUE)
entity = add_input_port("Target", PORT_TYPE_DATUM)
variable_name = add_input_port("Variable Name", PORT_TYPE_STRING)
new_value = add_input_port("New Value", PORT_TYPE_ANY)
@@ -31,7 +35,7 @@
return
var/resolved_new_value = new_value.value
if(islist(resolved_new_value))
if(islist(resolved_new_value) && resolve_weakrefs.value)
var/list/to_resolve = resolved_new_value
resolved_new_value = recursive_list_resolve(to_resolve)