mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-17 02:54:44 +01:00
add pixloc to forbidden vars, fixing the /proc/duplicate_object logic (#93054)
## About The Pull Request Add pixloc (new var added in 516) to forbidden vars, slight code cleanup for `/proc/duplicate_object` ## Why It's Good For The Game Atom duplication now properly handles copy location ## Changelog 🆑 fix: `/proc/duplicate_object` now properly sets copy location /🆑 --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars, list(
|
||||
"parent",
|
||||
"parent_type",
|
||||
"power_supply",
|
||||
"pixloc",
|
||||
"quirks",
|
||||
"reagents",
|
||||
"_signal_procs",
|
||||
@@ -65,14 +66,16 @@ GLOBAL_PROTECT(duplicate_forbidden_vars)
|
||||
|
||||
var/atom/made_copy = new original.type(spawning_location)
|
||||
|
||||
for(var/atom_vars in original.vars - GLOB.duplicate_forbidden_vars)
|
||||
if(islist(original.vars[atom_vars]))
|
||||
var/list/var_list = original.vars[atom_vars]
|
||||
made_copy.vars[atom_vars] = var_list.Copy()
|
||||
continue
|
||||
else if(istype(original.vars[atom_vars], /datum) || ismob(original.vars[atom_vars]))
|
||||
for(var/atom_vars in (original.vars - GLOB.duplicate_forbidden_vars))
|
||||
var/var_value = original.vars[atom_vars]
|
||||
if(isdatum(var_value))
|
||||
continue // this would reference the original's object, that will break when it is used or deleted.
|
||||
made_copy.vars[atom_vars] = original.vars[atom_vars]
|
||||
|
||||
if(islist(var_value))
|
||||
var/list/var_list = var_value
|
||||
var_value = var_list.Copy()
|
||||
|
||||
made_copy.vars[atom_vars] = var_value
|
||||
|
||||
if(isliving(made_copy))
|
||||
if(iscarbon(made_copy))
|
||||
|
||||
Reference in New Issue
Block a user