Fix settings code
This commit is contained in:
parent
f9d5edf7fe
commit
109e97ef31
19
config.lua
19
config.lua
|
@ -21,17 +21,10 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
local function setting(name, default)
|
local function setting(name, default)
|
||||||
name = name
|
local value = minetest.settings:get("money3." .. name)
|
||||||
local value
|
|
||||||
if minetest.settings then
|
|
||||||
value = minetest.settings:get("money3." .. name)
|
|
||||||
else
|
|
||||||
setting = minetest.setting_get("money3." .. name)
|
|
||||||
end
|
|
||||||
|
|
||||||
if value and type(default) == "number" then
|
if value and type(default) == "number" then
|
||||||
value = tonumber(value)
|
value = tonumber(value)
|
||||||
if value ~= value then value = false end
|
if value ~= value then value = nil end
|
||||||
end
|
end
|
||||||
|
|
||||||
if value and value ~= "" then
|
if value and value ~= "" then
|
||||||
|
@ -42,13 +35,7 @@ local function setting(name, default)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setting_bool(name, default)
|
local function setting_bool(name, default)
|
||||||
local value
|
local value = minetest.settings:get_bool("money3." .. name)
|
||||||
if minetest.settings then
|
|
||||||
value = minetest.settings:get_bool("money3" .. name)
|
|
||||||
else
|
|
||||||
value = minetest.setting_getbool("money3" .. name)
|
|
||||||
end
|
|
||||||
|
|
||||||
if value == nil then
|
if value == nil then
|
||||||
money3[name] = default
|
money3[name] = default
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue