[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 11:25:58 +01:00
committed by GitHub
parent 43ae84c64f
commit 1d2d7d2b6c
11 changed files with 35 additions and 27 deletions

View File

@@ -45,14 +45,6 @@
. = ..()
var/atom/movable/shell = parent.shell
component_data["shell_type"] = shell.type
var/list/shell_variables = list()
for(var/variable in shell.vars - GLOB.duplicate_forbidden_vars)
var/variable_data = shell.vars[variable]
if(!istext(variable_data) && !isnum(variable_data))
continue
shell_variables[variable] = variable_data
component_data["shell_variables"] = shell_variables
/obj/item/circuit_component/save_shell/load_data_from_list(list/component_data)
if(parent.shell)
@@ -63,12 +55,8 @@
return ..()
loaded_shell = new shell_type(drop_location())
log_admin_circuit("[parent.get_creator()] spawned in [shell_type] at [ADMIN_COORDJMP(loaded_shell)].")
if(!loaded_shell)
return
loaded_shell.datum_flags |= DF_VAR_EDITED
var/list/shell_variables = component_data["shell_variables"]
for(var/variable in shell_variables - GLOB.duplicate_forbidden_vars)
var/variable_data = shell_variables[variable]
loaded_shell.vv_edit_var(variable, variable_data)
return ..()