diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-16 22:15:51 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-16 22:15:51 +0300 |
| commit | f2a99859f0c66ba17765c036a173e7f29927327a (patch) | |
| tree | 88f05aaf4944f0fa5a575f9bc2ea852fa1d71e1c /path.c | |
| parent | c6db3a75f756d790ede966c34adc3dbc793803d1 (diff) | |
| download | astar-f2a99859f0c66ba17765c036a173e7f29927327a.tar.xz | |
Fix costs
Diffstat (limited to 'path.c')
| -rw-r--r-- | path.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |
