View Single Post
12-11-16, 11:44 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
A generic recursive table copy function:
Code:
function Copy_Table(src, dest)
	for index, value in pairs(src) do
		if type(value) == "table" then
			dest[index] = {}
			Copy_Table(value, dest[index])
		else
			dest[index] = value
		end
	end
end
Your destination can be a sub-table in another table.

Code:
ns.datamodules.DamageTaken = {}
Copy_Table(dt, ns.datamodules.DamageTaken)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-12-16 at 12:53 AM.
  Reply With Quote