From fc38ccb8dd1cef6a036a771c0b855a2201ca1f0c Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 2 Nov 2020 00:55:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=B7=A5=E5=85=B7=E5=87=BD=E6=95=B0co?= =?UTF-8?q?mpleteTable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/toolfunc.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Zframework/toolfunc.lua b/Zframework/toolfunc.lua index 8def14e4..f94db8cb 100644 --- a/Zframework/toolfunc.lua +++ b/Zframework/toolfunc.lua @@ -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