diff --git a/squirrelbattle/mapgeneration/randomwalk.py b/squirrelbattle/mapgeneration/randomwalk.py index 688c92c..419d342 100644 --- a/squirrelbattle/mapgeneration/randomwalk.py +++ b/squirrelbattle/mapgeneration/randomwalk.py @@ -48,7 +48,7 @@ class Walker: def move_in_bounds(self, width: int, height: int) -> None: nx, ny = self.next_pos() - if 0 < nx < width and 0 < ny < height: + if 0 < nx < width-1 and 0 < ny < height-1: self.x, self.y = nx, ny def split(self) -> "Walker": @@ -106,7 +106,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 Map.neighbourhood(grid, y, x, large=True)]) + c = sum([1 if grid[j][i] == Tile.FLOOR else 0 for j, i in Map.neighbourhood(grid, y, x)]) if c == 4 and self.params["no_lone_walls"]: result.tiles[y][x] = Tile.FLOOR elif c > 0: