From 737220f39ca6f9058d144562cb8e9644bd9fc9d3 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Sat, 30 Dec 2006 23:11:14 +0000 Subject: [PATCH] (svn r7668) -Backport from trunk (r7555): - off-by-one error due do truncation on division by 2 in heightmap code. --- heightmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/heightmap.c b/heightmap.c index ddcc50ccdd..aeaa5c38e6 100644 --- a/heightmap.c +++ b/heightmap.c @@ -318,8 +318,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 ((DistanceFromEdge(tile) <= 1) || - (row < row_pad) || (row >= (height - row_pad)) || - (col < col_pad) || (col >= (width - col_pad))) { + (row < row_pad) || (row >= (img_height + row_pad)) || + (col < col_pad) || (col >= (img_width + col_pad))) { SetTileHeight(tile, 0); } else { /* Use nearest neighbor resizing to scale map data.