Some buildmode additions, fixes (#52249)

* Adds outfit buildmode mode

* Adds a delete mode, makes copy compatible with humans

* comment fix

* AIstatus

* Tick the files, dummy

* none of that

* Some more copy restrictions

* Apply suggestions from code review

Co-authored-by: Rohesie <rohesie@gmail.com>

* Apply suggestions from code review

Co-authored-by: Rohesie <rohesie@gmail.com>

Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
skoglol
2020-07-20 18:16:37 -03:00
committed by GitHub
co-authored by Rohesie
parent 948e2cc7b8
commit d0df1a875c
6 changed files with 122 additions and 6 deletions
+10 -2
View File
@@ -1,7 +1,10 @@
//Vars that will not be copied when using /DuplicateObject
GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
"tag", "datum_components", "area", "type", "loc", "locs", "vars", "parent", "parent_type", "verbs", "ckey", "key",
"power_supply", "contents", "reagents", "stat", "x", "y", "z", "group", "atmos_adjacent_turfs", "comp_lookup"
"power_supply", "contents", "reagents", "stat", "x", "y", "z", "group", "atmos_adjacent_turfs", "comp_lookup",
"client_mobs_in_contents", "bodyparts", "internal_organs", "hand_bodyparts", "overlays", "overlays_standing", "hud_list",
"actions", "AIStatus", "appearance", "managed_overlays", "managed_vis_overlays", "computer_id", "lastKnownIP", "implants",
"tgui_shared_states"
))
/proc/DuplicateObject(atom/original, perfectcopy = TRUE, sameloc, atom/newloc = null, nerf, holoitem)
@@ -20,7 +23,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
if(islist(original.vars[V]))
var/list/L = original.vars[V]
O.vars[V] = L.Copy()
else if(istype(original.vars[V], /datum))
else if(istype(original.vars[V], /datum) || ismob(original.vars[V]))
continue // this would reference the original's object, that will break when it is used or deleted.
else
O.vars[V] = original.vars[V]
@@ -52,6 +55,11 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
contained_atom.flags_1 |= HOLOGRAM_1
if(M.circuit)
M.circuit.flags_1 |= HOLOGRAM_1
if(ismob(O)) //Overlays are carried over despite disallowing them, if a fix is found remove this.
var/mob/M = O
M.cut_overlays()
M.regenerate_icons()
return O