aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2022-02-04 20:28:43 +0100
committerGitHub <noreply@github.com>2022-02-04 20:28:43 +0100
commit1ee37148a8072fe6350124cd51c812c3d3fb069a (patch)
tree06e2d9153e7998ade54764a00788b5bcec6798b3 /builtin
parent1c73902005bb5c7a40be5571bff9c232d8c69536 (diff)
downloadminetest-1ee37148a8072fe6350124cd51c812c3d3fb069a.tar.gz
minetest-1ee37148a8072fe6350124cd51c812c3d3fb069a.tar.bz2
minetest-1ee37148a8072fe6350124cd51c812c3d3fb069a.zip
Fix types of get_mapgen_setting_noiseparams (#12025)
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/dlg_settings_advanced.lua30
1 files changed, 13 insertions, 17 deletions
diff --git a/builtin/mainmenu/dlg_settings_advanced.lua b/builtin/mainmenu/dlg_settings_advanced.lua
index 772509670..83f905446 100644
--- a/builtin/mainmenu/dlg_settings_advanced.lua
+++ b/builtin/mainmenu/dlg_settings_advanced.lua
@@ -517,24 +517,20 @@ end
local function get_current_np_group_as_string(setting)
local value = core.settings:get_np_group(setting.name)
- local t
if value == nil then
- t = setting.default
- else
- t = value.offset .. ", " ..
- value.scale .. ", (" ..
- value.spread.x .. ", " ..
- value.spread.y .. ", " ..
- value.spread.z .. "), " ..
- value.seed .. ", " ..
- value.octaves .. ", " ..
- value.persistence .. ", " ..
- value.lacunarity
- if value.flags ~= "" then
- t = t .. ", " .. value.flags
- end
+ return setting.default
end
- return t
+ return ("%g, %g, (%g, %g, %g), %g, %g, %g, %g"):format(
+ value.offset,
+ value.scale,
+ value.spread.x,
+ value.spread.y,
+ value.spread.z,
+ value.seed,
+ value.octaves,
+ value.persistence,
+ value.lacunarity
+ ) .. (value.flags ~= "" and (", " .. value.flags) or "")
end
local checkboxes = {} -- handle checkboxes events
@@ -667,7 +663,7 @@ local function create_change_setting_formspec(dialogdata)
elseif setting.type == "v3f" then
local val = get_current_value(setting)
local v3f = {}
- for line in val:gmatch("[+-]?[%d.-e]+") do -- All numeric characters
+ for line in val:gmatch("[+-]?[%d.+-eE]+") do -- All numeric characters
table.insert(v3f, line)
end