diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-14 21:41:33 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-14 21:41:33 +0300 |
| commit | db5320aa188d773c8edc32eee844127457ef280c (patch) | |
| tree | 8e673cdda6c78555542bf04605c5af45d49d3062 /map.c | |
| parent | de6a945fc804e8da48dcb9a284fdc79db0b9a06e (diff) | |
| download | astar-db5320aa188d773c8edc32eee844127457ef280c.tar.xz | |
Improve the Path type
Diffstat (limited to 'map.c')
| -rw-r--r-- | map.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -364,13 +364,13 @@ void draw_map(Map map, size_t width, size_t height, Position start, Position goa mvaddch(cur.y + map_offset_y, cur.x*2 + 1 + map_offset_x, c2); } - if (cur.x - path[cur.y][cur.x].parent.x == 0 || cur.y - path[cur.y][cur.x].parent.y == 0) { + if (cur.x - path[cur.y][cur.x].x == 0 || cur.y - path[cur.y][cur.x].y == 0) { length += COST_ORTHOGONAL; } else { length += COST_DIAGONAL; } prev = cur; - cur = path[cur.y][cur.x].parent; + cur = path[cur.y][cur.x]; } attroff(COLOR_PAIR(PATH_COLOR)); attron(COLOR_PAIR(WALL_TEXT_COLOR)); |
