From cdb554ab58e71bbe3d02135fcd007fc37a302454 Mon Sep 17 00:00:00 2001 From: Cyp Date: Sat, 23 Jan 2010 01:34:42 +0000 Subject: [PATCH] Fix units of mapTile(). git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9415 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map.h b/src/map.h index b977eaa7b..296b8d7e7 100644 --- a/src/map.h +++ b/src/map.h @@ -314,8 +314,8 @@ static inline WZ_DECL_PURE MAPTILE *mapTile(SDWORD x, SDWORD y) ASSERT(y >= -1, "mapTile: y value is too small (%d,%d) in %dx%d",x,y,mapWidth,mapHeight); x = (x < 0 ? 0 : x); y = (y < 0 ? 0 : y); - ASSERT(x < world_coord(mapWidth)+TILE_UNITS, "mapTile: x value is too big (%d,%d) in %dx%d",x,y,mapWidth,mapHeight); - ASSERT(y < world_coord(mapHeight)+TILE_UNITS, "mapTile: y value is too big (%d,%d) in %dx%d",x,y,mapWidth,mapHeight); + ASSERT(x < mapWidth + 1, "mapTile: x value is too big (%d,%d) in %dx%d",x,y,mapWidth,mapHeight); + ASSERT(y < mapHeight + 1, "mapTile: y value is too big (%d,%d) in %dx%d",x,y,mapWidth,mapHeight); x = (x >= mapWidth ? mapWidth - 1 : x); y = (y >= mapHeight ? mapHeight - 1 : y);