Ladders should spawn with no wall nearby
This commit is contained in:
parent
7e14122b8c
commit
9e099d0715
|
@ -208,7 +208,7 @@ class Generator:
|
|||
# place an exit ladder
|
||||
y, x = randint(0, height - 1), randint(0, width - 1)
|
||||
while level[y][x] != Tile.FLOOR or \
|
||||
sum([t.can_walk() for t in Map.neighbourhood(level, y, x, large=True)]) < 5:
|
||||
any([t.is_wall() for t in Map.neighbourhood(level, y, x, large=True)]):
|
||||
y, x = randint(0, height - 1), randint(0, width - 1)
|
||||
level[sy][sx] = Tile.LADDER
|
||||
|
||||
|
|
Loading…
Reference in New Issue