mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Fix types of get_mapgen_setting_noiseparams (#12025)
This commit is contained in:
parent
1c73902005
commit
1ee37148a8
4 changed files with 21 additions and 60 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue