Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Merge two tables, with variables from t2 overwriting t1 when a duplicate is found
- function table.merge(t1, t2)
- for k, v in pairs(t2) do
- if (type(v) == "table") and (type(t1[k] or false) == "table") then
- table.merge(t1[k], t2[k])
- else
- t1[k] = v
- end
- end
- return t1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement