Fixed maze converting

This commit is contained in:
Kyler Olsen 2024-11-10 20:51:19 -07:00
parent 0aad8728ff
commit 327f0d8f65
1 changed files with 4 additions and 4 deletions

View File

@ -199,16 +199,16 @@ class VectorWrapper(Maze):
while stack:
x, y = stack.pop()
if x - 1 >= 0 and cells[y][x - 1] == VectorEnum.Null and maze[cls.__from_vec(x) - 1, cls.__from_vec(y)]:
if x - 1 >= 0 and cells[y][x - 1] == VectorEnum.Null and not maze[cls.__from_vec(x) - 1, cls.__from_vec(y)]:
stack.append((x - 1, y))
cells[y][x - 1] = VectorEnum.Right
if x + 1 < width and cells[y][x + 1] == VectorEnum.Null and maze[cls.__from_vec(x) + 1, cls.__from_vec(y)]:
if x + 1 < width and cells[y][x + 1] == VectorEnum.Null and not maze[cls.__from_vec(x) + 1, cls.__from_vec(y)]:
stack.append((x + 1, y))
cells[y][x + 1] = VectorEnum.Left
if y - 1 >= 0 and cells[y - 1][x] == VectorEnum.Null and maze[cls.__from_vec(x), cls.__from_vec(y) - 1]:
if y - 1 >= 0 and cells[y - 1][x] == VectorEnum.Null and not maze[cls.__from_vec(x), cls.__from_vec(y) - 1]:
stack.append((x, y - 1))
cells[y - 1][x] = VectorEnum.Down
if y + 1 < height and cells[y + 1][x] == VectorEnum.Null and maze[cls.__from_vec(x), cls.__from_vec(y) + 1]:
if y + 1 < height and cells[y + 1][x] == VectorEnum.Null and not maze[cls.__from_vec(x), cls.__from_vec(y) + 1]:
stack.append((x, y + 1))
cells[y + 1][x] = VectorEnum.Up