diff --git a/configDefaults.lua b/configDefaults.lua index 9a4a6a1..8313c83 100644 --- a/configDefaults.lua +++ b/configDefaults.lua @@ -184,7 +184,7 @@ description = "A radon Shop", owner = nil, location = { - coordinates = {nil, nil, nil}, + coordinates = nil, description = nil, dimension = "overworld" } diff --git a/util/configHelpers.lua b/util/configHelpers.lua index 44af914..e9887d5 100644 --- a/util/configHelpers.lua +++ b/util/configHelpers.lua @@ -80,14 +80,20 @@ local newConfig = score.copyDeep(config) for k, addSchema in pairs(arrayAdds) do local subConfig = newConfig + local fullPath = nil for path in k:gmatch("([^%[?%]?%.?]+)") do + if fullPath then + fullPath = fullPath .. "." .. path + else + fullPath = path + end if path:match("%d+") then path = tonumber(path) or path end if subConfig[path] then subConfig = subConfig[path] else - if type(addSchema) == "string" and addSchema:sub(1,6) == "number" then + if fullPath == k and type(addSchema) == "string" and addSchema:sub(1,6) == "number" then subConfig[path] = 0 else subConfig[path] = {}