aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-14 21:50:55 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-14 21:50:55 +0300
commit768509d6bb91269abf1ee1d93c32d236b146e98a (patch)
tree99729eafbdbe8b496eb23033b541597384357416
parentdb5320aa188d773c8edc32eee844127457ef280c (diff)
downloadastar-768509d6bb91269abf1ee1d93c32d236b146e98a.tar.xz
Fix message printing leaving text behind
-rw-r--r--map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/map.c b/map.c
index dc0a605..3646c74 100644
--- a/map.c
+++ b/map.c
@@ -413,7 +413,7 @@ void draw_map(Map map, size_t width, size_t height, Position start, Position goa
}
void print_message(size_t height) {
- mvaddnstr(height + map_offset_y + 1, map_offset_x - 2, message, MESSAGE_MAX_SIZE);
+ mvaddnstr(height + map_offset_y + 1, map_offset_x - 2, message, MESSAGE_MAX_SIZE); clrtoeol();
}
void map_free(Map map, size_t height) {
@@ -437,7 +437,6 @@ void print_map_out(Map map, size_t width, size_t height) {
}
void map_editor(Map *map, size_t *width, size_t *height, Position *start, Position *goal) {
- clear();
draw_map(*map, *width, *height, *start, *goal, NULL, NULL, NULL, NULL);
set_message("You've entered the map editor. 'q' to quit");
print_message(*height);
@@ -638,6 +637,7 @@ void map_editor(Map *map, size_t *width, size_t *height, Position *start, Positi
}
}
} else { /* Only update the map if not a mouse event */
+
draw_map(*map, *width, *height, *start, *goal, NULL, NULL, NULL, NULL);
}
}