From d96ba29434808b94cccfcce7a675e5abbd2d846d Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Sun, 22 Mar 2026 12:23:35 +0300 Subject: Add ability to choose maps via args + create more maps + don't insert elements into a PPQ if there's one with better priority --- path.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'path.c') diff --git a/path.c b/path.c index 346f737..e2d42c5 100644 --- a/path.c +++ b/path.c @@ -27,11 +27,11 @@ Path breadth_first_search_path_4dir(Map map, size_t width, size_t height, Positi visited[cur.y][cur.x] = 1; if (cur.x == end.x && cur.y == end.y) { - break; + return path; /* Found path */ } Position na[4]; - unsigned int nc = neighbours(na, cur, width, height, visited); + unsigned int nc = neighbours_4dir(na, cur, width, height, visited); for (unsigned int i = 0; i < nc; i++) { /* The Russian constitution doesn't allow walking on walls */ @@ -42,7 +42,7 @@ Path breadth_first_search_path_4dir(Map map, size_t width, size_t height, Positi } } - return path; + return NULL; } /* FIXME: Rewrite this shit */ -- cgit v1.2.3