diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-26 18:18:01 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-26 20:45:30 -0700 |
commit | ec21450522e3c2124f3510eef5cfd88420483248 (patch) | |
tree | 2d3dbd342dccd34bc3545ae3ab7902042abe6815 /src/map/path.cpp | |
parent | 296629e067563e82b4a08b2a785d1c2f13b5a285 (diff) | |
download | tmwa-ec21450522e3c2124f3510eef5cfd88420483248.tar.gz tmwa-ec21450522e3c2124f3510eef5cfd88420483248.tar.bz2 tmwa-ec21450522e3c2124f3510eef5cfd88420483248.tar.xz tmwa-ec21450522e3c2124f3510eef5cfd88420483248.zip |
Low hanging fruit
Diffstat (limited to 'src/map/path.cpp')
-rw-r--r-- | src/map/path.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/map/path.cpp b/src/map/path.cpp index fb423e7..432d9cf 100644 --- a/src/map/path.cpp +++ b/src/map/path.cpp @@ -59,7 +59,7 @@ void push_heap_path(int *heap, struct tmp_path *tp, int index) { int i, h; - if (heap == NULL || tp == NULL) + if (heap == nullptr || tp == nullptr) { PRINTF("push_heap_path nullpo\n"_fmt); return; @@ -145,7 +145,7 @@ int calc_cost(struct tmp_path *p, int x1, int y1) { int xd, yd; - nullpo_ret(p); + nullpo_retz(p); xd = x1 - p->x; if (xd < 0) @@ -166,8 +166,8 @@ int add_path(int *heap, struct tmp_path *tp, int x, int y, int dist, { int i; - nullpo_ret(heap); - nullpo_ret(tp); + nullpo_retz(heap); + nullpo_retz(tp); i = calc_index(x, y); @@ -211,7 +211,7 @@ int add_path(int *heap, struct tmp_path *tp, int x, int y, int dist, static bool can_place(struct map_local *m, int x, int y) { - nullpo_ret(m); + nullpo_retz(m); return !bool(read_gatp(m, x, y) & MapCell::UNWALKABLE); } @@ -223,7 +223,7 @@ bool can_place(struct map_local *m, int x, int y) static int can_move(struct map_local *m, int x0, int y0, int x1, int y1) { - nullpo_ret(m); + nullpo_retz(m); if (x0 - x1 < -1 || x0 - x1 > 1 || y0 - y1 < -1 || y0 - y1 > 1) return 0; @@ -250,7 +250,7 @@ int path_search(struct walkpath_data *wpd, map_local *m, int x0, int y0, int x1, int i, rp, x, y; int dx, dy; - nullpo_ret(wpd); + nullpo_retz(wpd); assert (m->gat); map_local *md = m; |