fix handing of misery factor setting

develop
Myk Taylor 2023-12-31 00:24:12 -08:00
parent a970161585
commit b9591bb320
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

@ -58,6 +58,7 @@ Template for new versions:
## Fixes ## Fixes
- `sort`: fix potential crash when removing jobs directly from the Tasks info screen - `sort`: fix potential crash when removing jobs directly from the Tasks info screen
- `misery`: fix error when changing the misery factor
## Misc Improvements ## Misc Improvements
- wherever units are listed in DFHack tools, properties like "agitated" or (-trained-) are now shown - wherever units are listed in DFHack tools, properties like "agitated" or (-trained-) are now shown

@ -22,17 +22,17 @@ function parse_commandline(...)
local args, opts = {...}, {} local args, opts = {...}, {}
local positionals = process_args(opts, args) local positionals = process_args(opts, args)
if opts.help then if opts.help or not positionals then
return false return false
end end
local command = table.remove(positionals, 1) local command = table.remove(positionals, 1)
if not command or command == 'status' then if not command or command == 'status' then
status() status()
elseif command == 'factor' then
misery_setFactor(positionals[1])
elseif command == 'clear' then elseif command == 'clear' then
misery_clear() misery_clear()
elseif tonumber(command) then
misery_setFactor(tonumber(command))
else else
return false return false
end end