Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions fix/dry-buckets.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
local argparse = require("argparse")

local quiet = false

local emptied = 0
local in_building = 0
local water_type = dfhack.matinfo.find('WATER').type

argparse.processArgsGetopt({...}, {
{'q', 'quiet', handler=function() quiet = true end},
})

for _,item in ipairs(df.global.world.items.other.IN_PLAY) do
local container = dfhack.items.getContainer(item)
if container
Expand All @@ -19,7 +27,9 @@ for _,item in ipairs(df.global.world.items.other.IN_PLAY) do
end
end

print('Emptied '..emptied..' buckets.')
if emptied > 0 then
print(('Unclogged %d wells.'):format(in_building))
if not quiet then
print('Emptied '..emptied..' buckets.')
if emptied > 0 then
print(('Unclogged %d wells.'):format(in_building))
end
end
3 changes: 3 additions & 0 deletions internal/control-panel/registry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ COMMANDS_BY_IDX = {
{command='fix/dead-units', group='bugfix', mode='repeat', default=true,
desc='Fix units still being assigned to burrows after death.',
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dead-units', '--burrow', '-q', ']'}},
{command='fix/dry-buckets', group='bugfix', mode='repeat', default=true,
desc='Allow discarded water buckets and clogged wells to be used again.',
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dry-buckets', '-q', ']'}},
{command='fix/empty-wheelbarrows', group='bugfix', mode='repeat', default=true,
desc='Make abandoned full wheelbarrows usable again.',
params={'--time', '1', '--timeUnits', 'days', '--command', '[', 'fix/empty-wheelbarrows', '-q', ']'}},
Expand Down