aboutsummaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'path.c')
-rw-r--r--path.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/path.c b/path.c
index 85f7804..6909adc 100644
--- a/path.c
+++ b/path.c
@@ -228,6 +228,7 @@ Path astar_path(int dirs, Map map, size_t **cell_costs, size_t width, size_t hei
/* The Russian constitution doesn't allow walking on walls */
if (map[na[i].y][na[i].x] == WALL) continue;
+ /* Dijkstra's works with cell_costs, why does this not? */
size_t new_cost = cost_so_far[cur.y][cur.x] + costs[i];
if (new_cost < cost_so_far[na[i].y][na[i].x]) {
cost_so_far[na[i].y][na[i].x] = new_cost;