Fix the previous revision.

This commit is contained in:
Markus Armbruster 2006-04-05 18:15:07 +00:00
parent 6fdac645ba
commit 11e09910aa

View file

@ -151,19 +151,19 @@ bestownedpath(char *bpath, char *bigmap,
((i + 1) << 13) + routelen; ((i + 1) << 13) + routelen;
markedsectors++; markedsectors++;
} }
if (tx == ex && ty == ey) { }
bpath[routelen] = 'h'; if (tx == ex && ty == ey) {
bpath[routelen + 1] = 0; bpath[routelen] = 'h';
while (routelen--) { bpath[routelen + 1] = 0;
i = ((mapindex[tx][ty]) >> 13) - 1; while (routelen--) {
bpath[routelen] = dirchar[i]; i = (mapindex[tx][ty] >> 13) - 1;
tx = tx - dx[i]; bpath[routelen] = dirchar[i];
ty = ty - dy[i]; tx = tx - dx[i];
tx = XNORM(tx); ty = ty - dy[i];
ty = YNORM(ty); tx = XNORM(tx);
} ty = YNORM(ty);
return bpath;
} }
return bpath;
} }
} }
} }