Global Now Works No Bugs

This commit is contained in:
Cooldude2606
2018-06-01 00:30:00 +01:00
parent 2ddbd96476
commit 121dcbe70e
3 changed files with 62 additions and 35 deletions

View File

@@ -190,6 +190,7 @@ end
-- @treturn boolean success was the data set
Sync.info = setmetatable({},{
__index=global,
__newindex=global,
__call=function(tbl,set)
if not is_type(set,'table') then return false end
for key,value in pairs(set) do global[key] = value end
@@ -258,7 +259,7 @@ function Sync:on_init()
return true
end,function() local info = Sync.info return info.time..' (+'..(game.tick-info.time_set[1])..' Ticks)' end)
-- updates installed mods
Sync.info{mods=table.keys(loaded_modules)}
--Sync.info{mods=table.keys(loaded_modules)}
-- optinal dependies
if loaded_modules.Gui then verbose('ExpGamingCore.Gui is installed; Loading gui lib') require(module_path..'/src/gui') end
if loaded_modules.Ranking then verbose('ExpGamingCore.Ranking is installed; Loading ranking lib') require(module_path..'/src/ranking') end

View File

@@ -442,10 +442,10 @@ function table.tostring(tbl)
done[k] = true
end
for k, v in pairs(tbl) do
if not done[k] then
table.insert(result,
table.key_to_str(k).."="..table.val_to_str(v))
end
if not done[k] then
table.insert(result,
table.key_to_str(k).."="..table.val_to_str(v))
end
end
return "{"..table.concat(result,",") .."}"
end