mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2024-12-28 08:27:29 +01:00
Replace deprecated methods:
- 'setting_get' with 'settings:get' - 'setting_getbool' with 'settings:get_bool'
This commit is contained in:
parent
e1d2e84746
commit
d542d15fa4
@ -35,7 +35,7 @@ if use_speech_dispatcher then
|
||||
nil,
|
||||
""
|
||||
}
|
||||
local language = minetest.setting_get("language") or "en"
|
||||
local language = minetest.settings:get("language") or "en"
|
||||
if language ~= "en" then
|
||||
tab[3] = "-l "..language
|
||||
end
|
||||
|
@ -4,15 +4,15 @@ function moremesecons.setting(modname, settingname, default, min)
|
||||
local setting = "moremesecons_" .. modname .. "." .. settingname
|
||||
|
||||
if type(default) == "boolean" then
|
||||
local ret = minetest.setting_getbool(setting)
|
||||
local ret = minetest.settings:get_bool(setting)
|
||||
if ret == nil then
|
||||
ret = default
|
||||
end
|
||||
return ret
|
||||
elseif type(default) == "string" then
|
||||
return minetest.setting_get(setting) or default
|
||||
return minetest.settings:get(setting) or default
|
||||
elseif type(default) == "number" then
|
||||
local ret = tonumber(minetest.setting_get(setting)) or default
|
||||
local ret = tonumber(minetest.settings:get(setting)) or default
|
||||
if ret ~= ret then -- NaN
|
||||
minetest.log("warning", "[moremesecons_"..modname.."]: setting '"..setting.."' is NaN. Set to default value ("..tostring(default)..").")
|
||||
ret = default
|
||||
|
Loading…
Reference in New Issue
Block a user