diff options
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 */ |
