diff --git a/squirrelbattle/mapgeneration/randomwalk.py b/squirrelbattle/mapgeneration/randomwalk.py index 913599f..688c92c 100644 --- a/squirrelbattle/mapgeneration/randomwalk.py +++ b/squirrelbattle/mapgeneration/randomwalk.py @@ -96,8 +96,8 @@ class Generator: next_walker_pop.append(walker.split()) walkers = next_walker_pop - start_x, start_y = randint(0, width - 1), randint(0, height - 1) - while grid[start_y][start_x] != Tile.FLOOR: + start_x, start_y = -1, -1 + while grid[start_y][start_x] != Tile.FLOOR or start_x == -1: start_x, start_y = randint(0, width - 1), randint(0, height - 1) result = Map(width, height, grid, start_y, start_x)