Skip to content

Commit b79741c

Browse files
srifqiparamat
authored andcommittedSep 27, 2019
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.
1 parent 5fde697 commit b79741c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

Diff for: ‎builtin/mainmenu/dlg_settings_advanced.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,16 @@ local function create_change_setting_formspec(dialogdata)
688688
height = height - 1
689689

690690
local fields = {} -- To build formspec
691-
for i, name in ipairs(setting.possible) do
691+
local j = 1
692+
for _, name in ipairs(setting.possible) do
692693
if name:sub(1, 2) ~= "no" then
693694
local x = 0.5
694-
local y = height + i / 2 - 0.75
695-
if i - 1 >= flags_count / 2 then -- 2nd column
695+
local y = height + j / 2 - 0.75
696+
if j - 1 >= flags_count / 2 then -- 2nd column
696697
x = 5
697698
y = y - max_height
698699
end
700+
j = j + 1;
699701
local checkbox_name = "cb_" .. name
700702
local is_enabled = flags[name] == true -- to get false if nil
701703
checkboxes[checkbox_name] = is_enabled

Diff for: ‎builtin/settingtypes.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ mgv7_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2
16151615
[*Mapgen Carpathian]
16161616

16171617
# Map generation attributes specific to Mapgen Carpathian.
1618-
mgcarpathian_spflags (Mapgen Carpathian specific flags) flags caverns,norivers caverns,nocaverns,rivers,norivers
1618+
mgcarpathian_spflags (Mapgen Carpathian specific flags) flags caverns,norivers caverns,rivers,nocaverns,norivers
16191619

16201620
# Defines the base ground level.
16211621
mgcarpathian_base_level (Base ground level) float 12.0

0 commit comments

Comments
 (0)
Please sign in to comment.