Arreglado el color del marcador

This commit is contained in:
2022-11-02 00:17:25 +01:00
parent b4df851bd3
commit 12255750f6

View File

@@ -297,7 +297,11 @@ void Game::renderRoomName()
bool Game::changeRoom(std::string file)
{
// En las habitaciones los limites tienen la cadena del fichero o un 0 en caso de no limitar con nada
if (file != "0")
if (file == "0")
{
return false;
}
// Verifica que exista el fichero que se va a cargar
if (asset->get(file) != "")
{
@@ -309,8 +313,10 @@ bool Game::changeRoom(std::string file)
room = new Room(resource->getRoom(file), renderer, screen, asset, options, itemTracker, &board.items, debug);
// Actualiza el marcador
const color_t c = room->getBorderColor(); // Pone el color del marcador
board.color = (c.r + c.g + c.b == 0) ? stringToColor(options->palette, "white") : c; // Si el color es negro lo cambia a blanco
const color_t c = room->getBorderColor(); // Obtiene el color del vorde
const color_t cBlack = stringToColor(options->palette, "black");
board.color = (c.r == cBlack.r && c.g == cBlack.g && c.b == cBlack.b) ? stringToColor(options->palette, "white") : c; // Si el color es negro lo cambia a blanco
// board.color = (c.r + c.g + c.b == 0) ? stringToColor(options->palette, "white") : c; // Si el color es negro lo cambia a blanco
if (roomTracker->addRoom(file))
{ // Incrementa el contador de habitaciones visitadas
board.rooms++;