From 9e099d071509378b0e276b31c5cffb6aa0c94586 Mon Sep 17 00:00:00 2001 From: Charles Peyrat Date: Fri, 8 Jan 2021 19:50:27 +0100 Subject: [PATCH] Ladders should spawn with no wall nearby --- squirrelbattle/mapgeneration/broguelike.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/squirrelbattle/mapgeneration/broguelike.py b/squirrelbattle/mapgeneration/broguelike.py index 65eb337..2425df7 100644 --- a/squirrelbattle/mapgeneration/broguelike.py +++ b/squirrelbattle/mapgeneration/broguelike.py @@ -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