Resuelto un bug cuando el jugador salta fuera de la pantalla por arriba y no hay cambio de habitación
This commit is contained in:
@@ -734,9 +734,10 @@ tile_e Room::getTile(SDL_Point point)
|
|||||||
// Devuelve el tipo de tile que hay en ese indice
|
// Devuelve el tipo de tile que hay en ese indice
|
||||||
tile_e Room::getTile(int index)
|
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
|
// Las filas 0-8 son de tiles t_wall
|
||||||
if ((tileMap.at(index) >= 0) && (tileMap.at(index) < 9 * tileSetWidth))
|
if ((tileMap.at(index) >= 0) && (tileMap.at(index) < 9 * tileSetWidth))
|
||||||
|
|||||||
Reference in New Issue
Block a user