新工具函数completeTable

This commit is contained in:
MrZ626
2020-11-02 00:55:41 +08:00
parent 6be6012101
commit fc38ccb8dd

View File

@@ -564,6 +564,15 @@ function addToTable(G,base)--For all things in G if same type in base, push to b
end
end
end
function completeTable(G,base)--For all things in G if no val in base, push to base
for k,v in next,G do
if base[k]==nil then
base[k]=v
elseif type(v)=="table"and type(base[k])=="table"then
completeTable(v,base[k])
end
end
end
function splitStr(s,sep)
local L={}
local p1,p2=1--start,target