actually, rconnect is better, since we don't always need the entire scan.

This commit is contained in:
Enno Rehling 2019-08-26 22:49:32 +02:00
parent b81fe4e244
commit c87944afad

View file

@ -149,14 +149,12 @@ static region **internal_path_find(region * handle_start, const region * target,
fset(handle_start, RF_MARK); fset(handle_start, RF_MARK);
while (n != NULL) { while (n != NULL) {
region *adj[MAXDIRECTIONS];
region *r = n->r; region *r = n->r;
int depth = n->distance + 1; int depth = n->distance + 1;
if (n->distance >= maxlen) if (n->distance >= maxlen)
break; break;
get_neighbours(r, adj);
for (d = 0; d != MAXDIRECTIONS; ++d) { for (d = 0; d != MAXDIRECTIONS; ++d) {
region *rn = adj[d]; region *rn = rconnect(r, d);
if (rn && !fval(rn, RF_MARK) && allowed(r, rn)) { if (rn && !fval(rn, RF_MARK) && allowed(r, rn)) {
if (rn == target) { if (rn == target) {
int i = depth; int i = depth;