From 9de1b8ad6e115612e5c1bd053f7aae5718e6914f Mon Sep 17 00:00:00 2001 From: Sergio Valor Martinez Date: Tue, 8 Nov 2022 16:47:15 +0100 Subject: [PATCH] =?UTF-8?q?Resuelto=20un=20bug=20cuando=20el=20jugador=20s?= =?UTF-8?q?alta=20fuera=20de=20la=20pantalla=20por=20arriba=20y=20no=20hay?= =?UTF-8?q?=20cambio=20de=20habitaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/room.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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))