]> git.pond.sub.org Git - empserver/commitdiff
fairland: Use zero elevation for "not yet elevated"
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 16 Aug 2020 15:46:54 +0000 (17:46 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 19 Jan 2021 07:27:34 +0000 (08:27 +0100)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/util/fairland.c

index 9bb267c26d1d936826994d3ec13851176611efb1..40a01666164909b3b2390fbfb6c9952448c7c899 100644 (file)
@@ -1256,12 +1256,6 @@ grow_islands(void)
 static void
 create_elevations(void)
 {
-    int i, j;
-
-    for (i = 0; i < WORLD_X; i++) {
-       for (j = 0; j < WORLD_Y; j++)
-           elev[i][j] = -INFINITE_ELEVATION;
-    }
     init_distance_to_coast();
     elevate_land();
     elevate_sea();
@@ -1328,7 +1322,7 @@ elevate_land(void)
            for (i = 0; i < ns; ++i) {
                x = sectx[c][i];
                y = secty[c][i];
-               if (r < weight[i] && elev[x][y] == -INFINITE_ELEVATION &&
+               if (r < weight[i] && !elev[x][y] &&
                    (c >= nc ||
                     ((!(capx[c] == sectx[c][i] &&
                         capy[c] == secty[c][i])) &&
@@ -1354,7 +1348,7 @@ elevate_land(void)
            for (i = 0; i < ns; ++i) {
                x = sectx[c][i];
                y = secty[c][i];
-               if (elev[x][y] == -INFINITE_ELEVATION &&
+               if (!elev[x][y] &&
                    (c >= nc || ((!(capx[c] == sectx[c][i] &&
                                    capy[c] == secty[c][i])) &&
                                 (!(new_x(capx[c] + 2) == sectx[c][i] &&
@@ -1405,7 +1399,7 @@ elevate_sea(void)
     for (y = 0; y < WORLD_Y; ++y) {
        for (x = y % 2; x < WORLD_X; x += 2) {
            off = XYOFFSET(x, y);
-           if (elev[x][y] == -INFINITE_ELEVATION)
+           if (own[x][y] == -1)
                elev[x][y] = -roll(MIN(5, distance[off]) * 20 + 27);
        }
     }