diff --git a/docs/changelog.txt b/docs/changelog.txt index cd3a4a639..4d233a3e1 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -59,6 +59,7 @@ Template for new versions: ## Fixes - `sort`: fix mouse clicks falling through the squad assignment overlay panel when clicking on the panel but not on a clickable widget - `sort`: fix potential crash when removing jobs directly from the Tasks info screen +- `misery`: fix error when changing the misery factor ## Misc Improvements - wherever units are listed in DFHack tools, properties like "agitated" or (-trained-) are now shown diff --git a/plugins/lua/misery.lua b/plugins/lua/misery.lua index cd507c9b3..2ad8c06ca 100644 --- a/plugins/lua/misery.lua +++ b/plugins/lua/misery.lua @@ -22,17 +22,17 @@ function parse_commandline(...) local args, opts = {...}, {} local positionals = process_args(opts, args) - if opts.help then + if opts.help or not positionals then return false end local command = table.remove(positionals, 1) if not command or command == 'status' then status() - elseif command == 'factor' then - misery_setFactor(positionals[1]) elseif command == 'clear' then misery_clear() + elseif tonumber(command) then + misery_setFactor(tonumber(command)) else return false end