Skip to content

Commit

Permalink
allow extents to be connected diagonally
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Aug 5, 2020
1 parent c5ce24d commit de680e4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/quickfort/building.lua
Expand Up @@ -88,10 +88,14 @@ local function flood_fill(grid, x, y, seen_grid, data, db, aliases)
end
end
if not extent.specified then
return flood_fill(grid, x-1, y, seen_grid, data, db, aliases) +
flood_fill(grid, x+1, y, seen_grid, data, db, aliases) +
return flood_fill(grid, x-1, y-1, seen_grid, data, db, aliases) +
flood_fill(grid, x-1, y, seen_grid, data, db, aliases) +
flood_fill(grid, x-1, y+1, seen_grid, data, db, aliases) +
flood_fill(grid, x, y-1, seen_grid, data, db, aliases) +
flood_fill(grid, x, y+1, seen_grid, data, db, aliases)
flood_fill(grid, x, y+1, seen_grid, data, db, aliases) +
flood_fill(grid, x+1, y-1, seen_grid, data, db, aliases) +
flood_fill(grid, x+1, y, seen_grid, data, db, aliases) +
flood_fill(grid, x+1, y+1, seen_grid, data, db, aliases)
end
return 0
end
Expand Down

0 comments on commit de680e4

Please sign in to comment.