diff options
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)); |
