Skip to content

Commit

Permalink
better error message when failing to specify a feature or preset
Browse files Browse the repository at this point in the history
myk002 committed Oct 5, 2024

Verified

This commit was signed with the committer’s verified signature.
myk002 Myk
1 parent 95bd915 commit f5a85e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions agitation-rebalance.lua
Original file line number Diff line number Diff line change
@@ -326,7 +326,7 @@ end
local function do_preset(preset_name)
local preset = presets[preset_name]
if not preset then
qerror('preset not found: ' .. preset_name)
qerror(('preset not found: "%s"'):format(preset_name))
end
utils.assign(custom_difficulty, preset)
print('agitation-rebalance: preset applied: ' .. preset_name)
@@ -763,7 +763,7 @@ local function enable_feature(which, enabled)
end
local feature = state.features[which]
if feature == nil then
qerror('feature not found: ' .. which)
qerror(('feature not found: "%s"'):format(which))
end
state.features[which] = enabled
print(('feature %sabled: %s'):format(enabled and 'en' or 'dis', which))
@@ -777,9 +777,9 @@ if dfhack_flags and dfhack_flags.enable then
else do_disable()
end
elseif command == 'preset' then
do_preset(args[1])
do_preset(args[1] or '')
elseif command == 'enable' or command == 'disable' then
enable_feature(args[1], command == 'enable')
enable_feature(args[1] or '', command == 'enable')
elseif not command or command == 'status' then
print_status()
return

0 comments on commit f5a85e2

Please sign in to comment.