From f2a99859f0c66ba17765c036a173e7f29927327a Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Thu, 16 Apr 2026 22:15:51 +0300 Subject: Fix costs --- path.c | 1 + 1 file changed, 1 insertion(+) (limited to 'path.c') 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; -- cgit v1.2.3