Fixed Spider movement (it was not excluding itself after the first move
This commit is contained in:
parent
76e4d6be34
commit
5722ffab48
9 changed files with 64 additions and 22 deletions
|
|
@ -15,13 +15,13 @@ func simulate_move_recursive(start: Vector4i, max_num: int, exclude: Array[Vecto
|
|||
for neighbour in map.get_empty_neighbours(start):
|
||||
if neighbour in visited:
|
||||
continue
|
||||
|
||||
if not map.can_reach(start, neighbour):
|
||||
|
||||
if not map.can_reach(start, neighbour, exclude):
|
||||
continue
|
||||
|
||||
var same_neighbours = map.get_same_neighbours(start, neighbour)
|
||||
for e in exclude:
|
||||
same_neighbours.erase(e)
|
||||
#for e in exclude:
|
||||
# same_neighbours.erase(e)
|
||||
|
||||
if same_neighbours.size() > 0:
|
||||
visited.append(neighbour)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue