Merge pull request #11315 from Citadel-Station-13/Ghommie-patch-3-2
Fixing a little issue with the Holodeck's Kobayashi Maru phaser
This commit is contained in:
@@ -174,6 +174,15 @@
|
||||
L[T] = TRUE
|
||||
return L
|
||||
|
||||
/proc/typecacheof_assoc_list(list/pathlist, ignore_root_path = FALSE)
|
||||
. = list()
|
||||
if(!istype(pathlist))
|
||||
return
|
||||
for(var/P in pathlist)
|
||||
var/value = pathlist[P]
|
||||
for(var/T in (ignore_root_path ? subtypesof(P) : typesof(P)))
|
||||
.[T] = value
|
||||
|
||||
//Empties the list by setting the length to 0. Hopefully the elements get garbage collected
|
||||
/proc/clearlist(list/list)
|
||||
if(istype(list))
|
||||
@@ -579,4 +588,4 @@
|
||||
var/list/ret = list()
|
||||
for(var/key in input)
|
||||
ret += key
|
||||
return ret
|
||||
return ret
|
||||
|
||||
@@ -4,6 +4,10 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
|
||||
"power_supply", "contents", "reagents", "stat", "x", "y", "z", "group", "atmos_adjacent_turfs", "comp_lookup"
|
||||
))
|
||||
|
||||
GLOBAL_LIST_INIT(duplicate_forbidden_vars_by_type, typecacheof_assoc_list(list(
|
||||
/obj/item/gun/energy = "ammo_type"
|
||||
)))
|
||||
|
||||
/proc/DuplicateObject(atom/original, perfectcopy = TRUE, sameloc = FALSE, atom/newloc = null, nerf = FALSE, holoitem=FALSE)
|
||||
RETURN_TYPE(original.type)
|
||||
if(!original)
|
||||
@@ -16,7 +20,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
|
||||
O = new original.type(newloc)
|
||||
|
||||
if(perfectcopy && O && original)
|
||||
for(var/V in original.vars - GLOB.duplicate_forbidden_vars)
|
||||
for(var/V in original.vars - GLOB.duplicate_forbidden_vars - GLOB.duplicate_forbidden_vars_by_type[O.type])
|
||||
if(islist(original.vars[V]))
|
||||
var/list/L = original.vars[V]
|
||||
O.vars[V] = L.Copy()
|
||||
|
||||
@@ -67,8 +67,7 @@
|
||||
/obj/item/gun/energy/Destroy()
|
||||
if(flags_1 & INITIALIZED_1)
|
||||
QDEL_NULL(cell)
|
||||
if(!(flags_1 & HOLOGRAM_1)) //holodeck stuff.
|
||||
QDEL_LIST(ammo_type)
|
||||
QDEL_LIST(ammo_type)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user