From db5320aa188d773c8edc32eee844127457ef280c Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Tue, 14 Apr 2026 21:41:33 +0300 Subject: Improve the Path type --- map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'map.c') 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)); -- cgit v1.2.3