mirror of
https://github.com/minetest/minetest.git
synced 2025-03-06 20:48:40 +01:00
Fix enum setting used as requirement
This commit is contained in:
parent
36c9742c0a
commit
2fb9e4d18a
1 changed files with 4 additions and 1 deletions
|
@ -109,7 +109,7 @@ local function load()
|
||||||
local change_keys = {
|
local change_keys = {
|
||||||
query_text = "Controls",
|
query_text = "Controls",
|
||||||
requires = {
|
requires = {
|
||||||
touch_controls = false,
|
keyboard_mouse = true,
|
||||||
},
|
},
|
||||||
get_formspec = function(self, avail_w)
|
get_formspec = function(self, avail_w)
|
||||||
local btn_w = math.min(avail_w, 3)
|
local btn_w = math.min(avail_w, 3)
|
||||||
|
@ -377,6 +377,9 @@ local function check_requirements(name, requires)
|
||||||
local required_setting = get_setting_info(req_key)
|
local required_setting = get_setting_info(req_key)
|
||||||
if required_setting == nil then
|
if required_setting == nil then
|
||||||
core.log("warning", "Unknown setting " .. req_key .. " required by " .. (name or "???"))
|
core.log("warning", "Unknown setting " .. req_key .. " required by " .. (name or "???"))
|
||||||
|
elseif required_setting.type ~= "bool" then
|
||||||
|
core.log("warning", "Setting " .. req_key .. " of type " .. required_setting.type ..
|
||||||
|
" used as requirement by " .. (name or "???") .. ", only bool is allowed")
|
||||||
end
|
end
|
||||||
local actual_value = core.settings:get_bool(req_key,
|
local actual_value = core.settings:get_bool(req_key,
|
||||||
required_setting and core.is_yes(required_setting.default))
|
required_setting and core.is_yes(required_setting.default))
|
||||||
|
|
Loading…
Add table
Reference in a new issue