X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=t%2Fastar.c;fp=t%2Fastar.c;h=2ed40c07fc9072cf823c81306fc677d74d287751;hb=8ca2b8a06b00066a20f744a61c9bcdd65949a344;hp=af88268d4212af1c23484843108e5aeeb4144d81;hpb=5c48a06bc8649958e69013c53e925b83398ebc74;p=hexagon diff --git a/t/astar.c b/t/astar.c index af88268..2ed40c0 100644 --- a/t/astar.c +++ b/t/astar.c @@ -1,6 +1,6 @@ #include -#include "hexmap.h" +#include "hexagon.h" #include "tap.h" @@ -27,10 +27,9 @@ void pcheck(struct HL_astar *p, int x1, int y1, int x2, int y2, int expect) { int neighbor55(int hex, int dir) { int neighbor; - neighbor = HL_adjacent_hex(hex, dir); - if (neighbor == HL_cantor_xy(5,5)) { - return -1; - } + do { + neighbor = HL_adjacent_hex(hex, dir++); + } while (neighbor == HL_cantor_xy(5,5)); return neighbor; }