]> git.pond.sub.org Git - empserver/commitdiff
Fix the previous revision.
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 5 Apr 2006 18:15:07 +0000 (18:15 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 5 Apr 2006 18:15:07 +0000 (18:15 +0000)
src/lib/common/bestpath.c

index d897587432a2f207a0834d63acdc6d4774c454eb..67b4e05d3864119266dec11e1e6bfd4994589df1 100644 (file)
@@ -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;
                        }
                    }
                }