Changed Map.large_neighbourhood so we can also request only immediate neighbours, ignoring diagonals

This commit is contained in:
Charles Peyrat
2020-12-11 18:33:16 +01:00
parent d3c14a48ee
commit 7667079aa3
2 changed files with 7 additions and 6 deletions

View File

@ -108,7 +108,7 @@ class Generator:
for x in range(width):
for y in range(height):
if grid[y][x] == Tile.EMPTY:
c = sum([1 if grid[j][i] == Tile.FLOOR else 0 for j, i in result.large_neighbourhood(y, x)])
c = sum([1 if grid[j][i] == Tile.FLOOR else 0 for j, i in result.neighbourhood(y, x, large=True])
if c == 4 and self.params["no_lone_walls"]:
result.tiles[y][x] = Tile.FLOOR
elif c > 0: