commit 143c44f3eb289283b8cacedecd3bc464cbbf38e6
parent d9484e2714318809c8f6314b086956b43b965923
Author: Erik Letson <hmagellan@hmagellan.com>
Date: Tue, 27 Oct 2020 14:27:11 -0500
Much improved path nav in movement
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/board.py b/src/board.py
@@ -181,10 +181,9 @@ class BoardManager(manager.Manager):
if distances[index] >= min_val:
for n in adj_list[index]:
if adj_list[index][n] in distances.keys():
- if adj_list[index][n] not in self.previous_moves.keys():
- self.previous_moves[adj_list[index][n]] = index
new_dist = distances[index] + 1
if new_dist < distances[adj_list[index][n]]:
+ self.previous_moves[adj_list[index][n]] = index
distances[adj_list[index][n]] = new_dist
pq.put((adj_list[index][n], new_dist))