mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02:00
Fix enum setting used as requirement
This commit is contained in:
@@ -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))
|
||||||
|
Reference in New Issue
Block a user