diff --git a/changelog.txt b/changelog.txt index 7507a87ba..b58d36042 100644 --- a/changelog.txt +++ b/changelog.txt @@ -32,6 +32,7 @@ Template for new versions: ## Fixes - `gui/quickfort`: only print a help blueprint's text once even if the repeat setting is enabled +- `control-panel`: fix setting numeric preferences from the commandline ## Misc Improvements - `control-panel`: Add realistic-melting tweak to control-panel registry diff --git a/internal/control-panel/common.lua b/internal/control-panel/common.lua index 21472c45c..922f05364 100644 --- a/internal/control-panel/common.lua +++ b/internal/control-panel/common.lua @@ -180,6 +180,9 @@ function set_preference(data, in_value) if expected_type == 'boolean' and type(value) ~= 'boolean' then value = argparse.boolean(value) end + if expected_type == "number" then + value = tonumber(value) or value + end local actual_type = type(value) if actual_type ~= expected_type then qerror(('"%s" has an unexpected value type: got: %s; expected: %s'):format(