aboutsummaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'path.c')
-rw-r--r--path.c6
1 files changed, 3 insertions, 3 deletions
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 */