Originally Posted by ingeniousclown
This already exists as a global function implemented by ZO:
lua Code:
function ZO_DeepTableCopy(source, dest) dest = dest or {} for k, v in pairs(source) do if type(v) == "table" then dest[k] = ZO_DeepTableCopy(v) else dest[k] = v end end return dest end
This excludes metatables, however, and at a glance, it looks like it will crash on any circular reference.
|
Since I only have data I want to hand out data from my Saved Vars without having any side effects this is ideal.