aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-14 21:41:33 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-14 21:41:33 +0300
commitdb5320aa188d773c8edc32eee844127457ef280c (patch)
tree8e673cdda6c78555542bf04605c5af45d49d3062 /map.c
parentde6a945fc804e8da48dcb9a284fdc79db0b9a06e (diff)
downloadastar-db5320aa188d773c8edc32eee844127457ef280c.tar.xz
Improve the Path type
Diffstat (limited to 'map.c')
-rw-r--r--map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/map.c b/map.c
index f6cb840..dc0a605 100644
--- a/map.c
+++ b/map.c
@@ -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));