summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-02-04 01:07:53 +0000
committersmatz <smatz@openttd.org>2009-02-04 01:07:53 +0000
commitd2a725ec949c23b89187e9616ce63e7cb59154f4 (patch)
tree26fedf1e34f0d650e4e7bab95a0a9c7a5d49a38d /src
parentcabedf173d35bebb82058181f8d371565b39813e (diff)
downloadopenttd-d2a725ec949c23b89187e9616ce63e7cb59154f4.tar.xz
(svn r15332) -Fix (r15190): terrain generated from heightmaps always was at sea level at both southern borders
Diffstat (limited to 'src')
-rw-r--r--src/heightmap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index 27d247bfa..b9614e595 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -331,8 +331,8 @@ static void GrayscaleToMapHeights(uint img_width, uint img_height, byte *map)
/* Check if current tile is within the 1-pixel map edge or padding regions */
if ((!_settings_game.construction.freeform_edges && DistanceFromEdge(tile) <= 1) ||
- (row < row_pad) || (row >= (height - row_pad - 1)) ||
- (col < col_pad) || (col >= (width - col_pad - 1))) {
+ (row < row_pad) || (row >= (height - row_pad - (_settings_game.construction.freeform_edges ? 0 : 1))) ||
+ (col < col_pad) || (col >= (width - col_pad - (_settings_game.construction.freeform_edges ? 0 : 1)))) {
SetTileHeight(tile, 0);
} else {
/* Use nearest neighbor resizing to scale map data.