]> git.pond.sub.org Git - empserver/commitdiff
Clean up confusing loop control in fairland
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 25 Feb 2008 20:20:48 +0000 (21:20 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 14 Mar 2008 19:25:09 +0000 (20:25 +0100)
src/util/fairland.c

index 4598eba614b08318f526c109144bc6866dd2a90a..20c47158acc4b30510878e885fcc15af64cda7bd 100644 (file)
@@ -486,7 +486,7 @@ init(void)
        }
     }
 
        }
     }
 
-    for (i = 0; i < nc; ++i, xx += 2) {
+    for (i = 0; i < nc; ++i) {
        if (xx >= WORLD_X) {
            ++yy;
            xx = yy % 2;
        if (xx >= WORLD_X) {
            ++yy;
            xx = yy % 2;
@@ -497,6 +497,7 @@ init(void)
        }
        capx[i] = xx;
        capy[i] = yy;
        }
        capx[i] = xx;
        capy[i] = yy;
+       xx += 2;
     }
     for (i = 0; i < STABLE_CYCLE; ++i)
        mc[i] = i;
     }
     for (i = 0; i < STABLE_CYCLE; ++i)
        mc[i] = i;
@@ -1082,7 +1083,7 @@ write_sects(void)
     /*  sct = &sects[0][0]; */
     sct = sectsbuf;
     for (y = 0; y < YSIZE; y++) {
     /*  sct = &sects[0][0]; */
     sct = sectsbuf;
     for (y = 0; y < YSIZE; y++) {
-       for (x = 0; x < XSIZE; x++, sct++) {
+       for (x = 0; x < XSIZE; x++) {
            fl_sct_init(x * 2 + (y & 1), y, sct);
            total = elev[sct->sct_x][y];
            if (total < LANDMIN) {
            fl_sct_init(x * 2 + (y & 1), y, sct);
            total = elev[sct->sct_x][y];
            if (total < LANDMIN) {
@@ -1099,6 +1100,7 @@ write_sects(void)
            sct->sct_newtype = sct->sct_type;
            if (ORE)
                add_resources(sct);
            sct->sct_newtype = sct->sct_type;
            if (ORE)
                add_resources(sct);
+           sct++;
        }
     }
     if (AIRPORT_MARKER)
        }
     }
     if (AIRPORT_MARKER)