2014-10-12 21:54:55 -06:00
|
|
|
-- Remove all aquifers from the map
|
|
|
|
|
|
|
|
local function drain()
|
2014-10-12 22:28:23 -06:00
|
|
|
local layers = {}
|
2014-10-12 21:54:55 -06:00
|
|
|
local layer_count = 0
|
|
|
|
local tile_count = 0
|
|
|
|
|
|
|
|
for k, block in ipairs(df.global.world.map.map_blocks) do
|
|
|
|
if block.flags.has_aquifer then
|
|
|
|
block.flags.has_aquifer = false
|
|
|
|
block.flags.check_aquifer = false
|
|
|
|
|
|
|
|
for x, row in ipairs(block.designation) do
|
|
|
|
for y, tile in ipairs(row) do
|
|
|
|
if tile.water_table then
|
|
|
|
tile.water_table = false
|
|
|
|
tile_count = tile_count + 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-10-12 22:28:23 -06:00
|
|
|
if not layers[block.map_pos.z] then
|
|
|
|
layers[block.map_pos.z] = true
|
2014-10-12 21:54:55 -06:00
|
|
|
layer_count = layer_count + 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
print("Cleared "..tile_count.." aquifer tile"..((tile_count ~= 1) and "s" or "")..
|
|
|
|
" in "..layer_count.." layer"..((layer_count ~= 1) and "s" or "")..".")
|
|
|
|
end
|
|
|
|
|
|
|
|
drain(...)
|