aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-23 14:37:26 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-23 14:37:26 +0300
commit53ed90ab4f3b493f1c3abd4aff4fa45f3f8a0909 (patch)
treea7b01bf378aee70847fcda0aa49c8274eebcca67 /map.c
parent6834ffa31842ca249514854bac8bae0f0022f104 (diff)
downloadastar-53ed90ab4f3b493f1c3abd4aff4fa45f3f8a0909.tar.xz
Make path reversable in map_editor()
Diffstat (limited to 'map.c')
-rw-r--r--map.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/map.c b/map.c
index 005936f..85cc073 100644
--- a/map.c
+++ b/map.c
@@ -660,6 +660,8 @@ void map_editor(Map *map, size_t *width, size_t *height, Position *start, Positi
*
* [d] - Switch algorithms (A* or Dijsktra's)
*
+ * [r] - Reverse path
+ *
* [s] - Save the map to a plaintext file
*
* [q] - Exit the map editor
@@ -721,6 +723,10 @@ void map_editor(Map *map, size_t *width, size_t *height, Position *start, Positi
if (should_pathfind) path = path_func(dirs, *map, NULL, *width, *height, *start, *goal, visited, 0);
break;
+ case 'r':
+ path_reverse(&path, *width, *height, start, goal);
+ break;
+
case 's':
curs_set(2); /* Show the cursor */
echo(); /* Echo characters */