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);