Skip to content

Commit

Permalink
Improve fix/dry-buckets checks
Browse files Browse the repository at this point in the history
  • Loading branch information
PeridexisErrant committed Nov 23, 2015
1 parent 1067eeb commit 7ed5a81
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/fix/dry-buckets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ local emptied = 0
local water_type = dfhack.matinfo.find('WATER').type

for _,item in ipairs(df.global.world.items.all) do
if item:getMaterial() == water_type
and item:getType() == df.item_types.LIQUID_MISC
and dfhack.items.getContainer ~= nil
container = dfhack.items.getContainer(item)
if container ~= nil
and container:getType() == dfhack.item_type.BUCKET
and not (container.flags.in_job or container.flags.in_building)
and item:getMaterial() == water_type
and item:getType() == dfhack.item_type.LIQUID_MISC
and not (item.flags.in_job or item.flags.in_building) then
dfhack.items.remove(item)
emptied = emptied + 1
Expand Down

0 comments on commit 7ed5a81

Please sign in to comment.