diff --git a/src/lib/common/bestpath.c b/src/lib/common/bestpath.c index d8975874..67b4e05d 100644 --- a/src/lib/common/bestpath.c +++ b/src/lib/common/bestpath.c @@ -151,19 +151,19 @@ bestownedpath(char *bpath, char *bigmap, ((i + 1) << 13) + routelen; markedsectors++; } - if (tx == ex && ty == ey) { - bpath[routelen] = 'h'; - bpath[routelen + 1] = 0; - while (routelen--) { - i = ((mapindex[tx][ty]) >> 13) - 1; - bpath[routelen] = dirchar[i]; - tx = tx - dx[i]; - ty = ty - dy[i]; - tx = XNORM(tx); - ty = YNORM(ty); - } - return bpath; + } + if (tx == ex && ty == ey) { + bpath[routelen] = 'h'; + bpath[routelen + 1] = 0; + while (routelen--) { + i = (mapindex[tx][ty] >> 13) - 1; + bpath[routelen] = dirchar[i]; + tx = tx - dx[i]; + ty = ty - dy[i]; + tx = XNORM(tx); + ty = YNORM(ty); } + return bpath; } } }