From b3d564c8ae08bec8cb7a86477accd2dd09571baa Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 16 Aug 2020 17:46:54 +0200 Subject: [PATCH] fairland: Use zero elevation for "not yet elevated" Signed-off-by: Markus Armbruster --- src/util/fairland.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/util/fairland.c b/src/util/fairland.c index 9bb267c26..40a016661 100644 --- a/src/util/fairland.c +++ b/src/util/fairland.c @@ -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); } } -- 2.43.0