]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/nxtsct.c
Indented with src/scripts/indent-emp.
[empserver] / src / lib / subs / nxtsct.c
index 12265ff08600e36d7b092c550497738392546119..0de03716925dbed89a1be7ca300a486818c3e849 100644 (file)
 int
 nxtsct(register struct nstr_sect *np, struct sctstr *sp)
 {
 int
 nxtsct(register struct nstr_sect *np, struct sctstr *sp)
 {
-       while (1) {
-               np->dx++;
-               np->x++;
-               if (np->x >= WORLD_X)
-                       np->x = 0;
-               if (np->dx >= np->range.width) {
-                       np->dx = 0;
-                       np->x = np->range.lx;
-                       np->dy++;
-                       if (np->dy >= np->range.height)
-                               return 0;
-                       np->y++;
-                       if (np->y >= WORLD_Y)
-                               np->y = 0;
-               }
-               if ((np->y + np->x) & 01)
-                       continue;
-               if (np->type == NS_DIST) {
-                       np->curdist = mapdist(np->x, np->y, np->cx, np->cy);
-                       if (np->curdist > np->dist)
-                               continue;
-               }
-               np->id = sctoff(np->x, np->y);
-               if (!np->read(EF_SECTOR, np->id, (caddr_t) sp))
-                       continue;
-               if (np->ncond == 0)
-                       return 1;
-               if (nstr_exec(np->cond, np->ncond, (caddr_t)sp, EF_SECTOR))
-                       return 1;
+    while (1) {
+       np->dx++;
+       np->x++;
+       if (np->x >= WORLD_X)
+           np->x = 0;
+       if (np->dx >= np->range.width) {
+           np->dx = 0;
+           np->x = np->range.lx;
+           np->dy++;
+           if (np->dy >= np->range.height)
+               return 0;
+           np->y++;
+           if (np->y >= WORLD_Y)
+               np->y = 0;
        }
        }
-       /*NOTREACHED*/
+       if ((np->y + np->x) & 01)
+           continue;
+       if (np->type == NS_DIST) {
+           np->curdist = mapdist(np->x, np->y, np->cx, np->cy);
+           if (np->curdist > np->dist)
+               continue;
+       }
+       np->id = sctoff(np->x, np->y);
+       if (!np->read(EF_SECTOR, np->id, (caddr_t)sp))
+           continue;
+       if (np->ncond == 0)
+           return 1;
+       if (nstr_exec(np->cond, np->ncond, (caddr_t)sp, EF_SECTOR))
+           return 1;
+    }
+    /*NOTREACHED*/
 }
 }