No way…
It seems to be working atm! Just going through and testing to make sure every bit of it is saving, as well as picking up if anything new is added
No way…
It seems to be working atm! Just going through and testing to make sure every bit of it is saving, as well as picking up if anything new is added
Yea, I have ran a test and its working fine.
function updateObject(old, new)
local update = {}
for name, variable in next, new do
update[name] = (type(variable) == 'table' and old[name] and updateObject(old[name], variable)) or old[name] or variable
end
return update
end
local old = {test1 = "hello", test2 = {"a", "b", "c"}, test3 = 'test'}
local new = {test0 = "hey", test1 = "hello", test2 = {"a", "b", "c", "d", "e"}}
local updatedTable = updateObject(old, new)
for i,v in next, updatedTable do
print(i,v)
if type(v) == 'table' then
for i,v in next, v do
print('\t', i, v)
end
end
end
--[[
OUTPUT:
test0 hey
test1 hello
test2 table: 000001F7B0EBE900
1 a
2 b
3 c
4 d
5 e
--]]