aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu/dlg_settings_advanced.lua
diff options
context:
space:
mode:
authorMuhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>2019-09-28 01:13:08 +0700
committerParamat <paramat@users.noreply.github.com>2019-09-27 19:13:08 +0100
commitb79741c90ffffac6fb24783b38c5b507316cbcc8 (patch)
tree9fd1bbaacecbef9c6ea693cea51d0270e6d3f01b /builtin/mainmenu/dlg_settings_advanced.lua
parent5fde69798c69b26b8f1cc5c3ed5b823d691599fd (diff)
downloadminetest-b79741c90ffffac6fb24783b38c5b507316cbcc8.tar.gz
minetest-b79741c90ffffac6fb24783b38c5b507316cbcc8.tar.bz2
minetest-b79741c90ffffac6fb24783b38c5b507316cbcc8.zip
All settings: Fix missing flags checkbox caused by 'possible flags' order (#8997)
Previously, the 'rivers' checkbox was missing for mgcarpathian, caused by the 'possible flags' order: 'caverns,nocaverns,rivers,norivers'. Also reorder mgcarpathian 'possible flags', but only for consistency.
Diffstat (limited to 'builtin/mainmenu/dlg_settings_advanced.lua')
-rw-r--r--builtin/mainmenu/dlg_settings_advanced.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/mainmenu/dlg_settings_advanced.lua b/builtin/mainmenu/dlg_settings_advanced.lua
index 6d40ace35..24b71d957 100644
--- a/builtin/mainmenu/dlg_settings_advanced.lua
+++ b/builtin/mainmenu/dlg_settings_advanced.lua
@@ -688,14 +688,16 @@ local function create_change_setting_formspec(dialogdata)
height = height - 1
local fields = {} -- To build formspec
- for i, name in ipairs(setting.possible) do
+ local j = 1
+ for _, name in ipairs(setting.possible) do
if name:sub(1, 2) ~= "no" then
local x = 0.5
- local y = height + i / 2 - 0.75
- if i - 1 >= flags_count / 2 then -- 2nd column
+ local y = height + j / 2 - 0.75
+ if j - 1 >= flags_count / 2 then -- 2nd column
x = 5
y = y - max_height
end
+ j = j + 1;
local checkbox_name = "cb_" .. name
local is_enabled = flags[name] == true -- to get false if nil
checkboxes[checkbox_name] = is_enabled