From 109e97ef31c68d4c64d8980d29a5144c0194b99b Mon Sep 17 00:00:00 2001 From: luk3yx Date: Sun, 27 Nov 2022 15:40:08 +1300 Subject: [PATCH] Fix settings code --- config.lua | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/config.lua b/config.lua index f8aa32e..02a321e 100644 --- a/config.lua +++ b/config.lua @@ -21,17 +21,10 @@ -- local function setting(name, default) - name = name - local value - if minetest.settings then - value = minetest.settings:get("money3." .. name) - else - setting = minetest.setting_get("money3." .. name) - end - + local value = minetest.settings:get("money3." .. name) if value and type(default) == "number" then value = tonumber(value) - if value ~= value then value = false end + if value ~= value then value = nil end end if value and value ~= "" then @@ -42,13 +35,7 @@ local function setting(name, default) end local function setting_bool(name, default) - local value - if minetest.settings then - value = minetest.settings:get_bool("money3" .. name) - else - value = minetest.setting_getbool("money3" .. name) - end - + local value = minetest.settings:get_bool("money3." .. name) if value == nil then money3[name] = default else