[MIRROR] Fixes an issue with tags for mobs not properly being handled correctly and adds logging to admin circuits [MDB IGNORE] (#11441)

* Fixes an issue with tags for mobs not properly being handled correctly and adds logging to admin circuits (#64821)

Tags would bug out due to how the 'Save Shell' component would copy all the variables on an object except a few restricted ones, though this proved to be very buggy.
The duplicator part has been removed and more proper logging has been added.
To compensate for the duplicator part being removed, admin circuit display names will now replace the entire name of the shell.

* Fixes an issue with tags for mobs not properly being handled correctly and adds logging to admin circuits

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-02-11 10:25:58 +00:00
committed by GitHub
co-authored by Watermelon914
parent 43ae84c64f
commit 1d2d7d2b6c
11 changed files with 35 additions and 27 deletions
+3 -3
View File
@@ -16,9 +16,6 @@ GLOBAL_LIST_INIT(circuit_dupe_whitelisted_types, list(
LOG_ERROR(errors, "Invalid json format!")
return
if(general_data["display_name"])
set_display_name(general_data["display_name"])
var/list/variable_data = general_data["variables"]
for(var/list/variable as anything in variable_data)
var/variable_name = variable["name"]
@@ -32,6 +29,9 @@ GLOBAL_LIST_INIT(circuit_dupe_whitelisted_types, list(
admin_only = general_data["admin_only"]
if(general_data["display_name"])
set_display_name(general_data["display_name"])
var/list/circuit_data = general_data["components"]
var/list/identifiers_to_circuit = list()
for(var/identifier in circuit_data)
@@ -541,16 +541,9 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
var/new_name = params["display_name"]
if(new_name)
set_display_name(strip_html(params["display_name"], label_max_length))
set_display_name(params["display_name"])
else
set_display_name("")
if(shell)
if(display_name != "")
shell.name = "[initial(shell.name)] ([display_name])"
else
shell.name = initial(shell.name)
. = TRUE
if("set_examined_component")
var/component_id = text2num(params["component_id"])
@@ -666,7 +659,17 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
/// Sets the display name that appears on the shell.
/obj/item/integrated_circuit/proc/set_display_name(new_name)
display_name = new_name
display_name = copytext(new_name, 1, label_max_length)
if(!shell)
return
if(display_name != "")
if(!admin_only)
shell.name = "[initial(shell.name)] ([strip_html(display_name)])"
else
shell.name = display_name
else
shell.name = initial(shell.name)
/**
* Returns the creator of the integrated circuit. Used in admin messages and other related things.