Improve drybuckets checks

Must also be liquid and in a container.
develop
PeridexisErrant 2015-11-17 16:52:06 +09:30
parent 842b9c5191
commit 1067eeb6d3
1 changed files with 4 additions and 1 deletions

@ -13,7 +13,10 @@ local emptied = 0
local water_type = dfhack.matinfo.find('WATER').type local water_type = dfhack.matinfo.find('WATER').type
for _,item in ipairs(df.global.world.items.all) do for _,item in ipairs(df.global.world.items.all) do
if item:getMaterial() == water_type and not (item.flags.in_job or item.flags.in_building) then if item:getMaterial() == water_type
and item:getType() == df.item_types.LIQUID_MISC
and dfhack.items.getContainer ~= nil
and not (item.flags.in_job or item.flags.in_building) then
dfhack.items.remove(item) dfhack.items.remove(item)
emptied = emptied + 1 emptied = emptied + 1
end end