Only empty tiles should be changed to walls, obviously...
This commit is contained in:
parent
757a460a44
commit
c8b07b3bf5
|
@ -107,10 +107,11 @@ class Generator:
|
||||||
# post-processing: add walls
|
# post-processing: add walls
|
||||||
for x in range(width):
|
for x in range(width):
|
||||||
for y in range(height):
|
for y in range(height):
|
||||||
c = sum([1 if grid[j][i] == Tile.FLOOR else 0 for j, i in result.large_neighbourhood(y, x)])
|
if grid[y][x] == Tile.EMPTY:
|
||||||
if c == 4 and self.params["no_lone_walls"]:
|
c = sum([1 if grid[j][i] == Tile.FLOOR else 0 for j, i in result.large_neighbourhood(y, x)])
|
||||||
result.tiles[y][x] = Tile.FLOOR
|
if c == 4 and self.params["no_lone_walls"]:
|
||||||
elif c > 0:
|
result.tiles[y][x] = Tile.FLOOR
|
||||||
result.tiles[y][x] = Tile.WALL
|
elif c > 0:
|
||||||
|
result.tiles[y][x] = Tile.WALL
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue