diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-22 12:23:35 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-22 12:23:35 +0300 |
| commit | d96ba29434808b94cccfcce7a675e5abbd2d846d (patch) | |
| tree | f02ce36a0ec0acbc87d0a454062e6300445ad0f2 /path.c | |
| parent | 348c700fedae3b0005660d8c42941fe7c69027d4 (diff) | |
Add ability to choose maps via args + create more maps + don't insert elements into a PPQ if there's one with better priority
Diffstat (limited to 'path.c')
| -rw-r--r-- | path.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 */ |
