diff --git a/source/room.cpp b/source/room.cpp index fb03f2b..18ebd1d 100644 --- a/source/room.cpp +++ b/source/room.cpp @@ -734,9 +734,10 @@ tile_e Room::getTile(SDL_Point point) // Devuelve el tipo de tile que hay en ese indice tile_e Room::getTile(int index) { - const int maxTile = mapWidth * mapHeight; + //const bool onRange = (index > -1) && (index < mapWidth * mapHeight); + const bool onRange = (index > -1) && (index < (int)tileMap.size()); - if (index < maxTile) + if (onRange) { // Las filas 0-8 son de tiles t_wall if ((tileMap.at(index) >= 0) && (tileMap.at(index) < 9 * tileSetWidth))