diff --git a/source/ending.cpp b/source/ending.cpp index e29da98..bc321fc 100644 --- a/source/ending.cpp +++ b/source/ending.cpp @@ -161,7 +161,8 @@ void Ending::checkEventHandler() switch (eventHandler->key.keysym.scancode) { case SDL_SCANCODE_ESCAPE: - section->name = SECTION_PROG_QUIT; + section->name = SECTION_PROG_LOGO; + section->subsection = SUBSECTION_LOGO_TO_INTRO; break; case SDL_SCANCODE_B: diff --git a/source/ending2.cpp b/source/ending2.cpp index d179701..b2db67c 100644 --- a/source/ending2.cpp +++ b/source/ending2.cpp @@ -195,7 +195,8 @@ void Ending2::checkEventHandler() switch (eventHandler->key.keysym.scancode) { case SDL_SCANCODE_ESCAPE: - section->name = SECTION_PROG_QUIT; + section->name = SECTION_PROG_LOGO; + section->subsection = SUBSECTION_LOGO_TO_INTRO; break; case SDL_SCANCODE_B: diff --git a/source/game.cpp b/source/game.cpp index e01b33f..1da8fff 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -127,7 +127,7 @@ void Game::checkEventHandler() reLoadTextures(); } - if ((eventHandler->type == SDL_KEYDOWN) and (eventHandler->key.repeat == 0)) + if (eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) { switch (eventHandler->key.keysym.scancode) { @@ -577,10 +577,9 @@ void Game::setScoreBoardColor() // Comprueba si ha finalizado el juego bool Game::checkEndGame() { - const bool isOnTheRoom = room->getName() == "THE JAIL"; // Estar en la habitación que toca - // const bool haveTheItems = board.items >= int(totalItems * 0.9f) || options->cheat.jailEnabled; // Con mas del 90% de los items recogidos - const bool haveTheItems = board.items == 2; - const bool isOnTheDoor = player->getRect().x <= 128; // Y en la ubicación que toca (En la puerta) + const bool isOnTheRoom = room->getName() == "THE JAIL"; // Estar en la habitación que toca + const bool haveTheItems = board.items >= int(totalItems * 0.9f) || options->cheat.jailEnabled; // Con mas del 90% de los items recogidos + const bool isOnTheDoor = player->getRect().x <= 128; // Y en la ubicación que toca (En la puerta) if (haveTheItems) { @@ -666,7 +665,7 @@ void Game::checkRestoringJail() JA_PlaySound(deathSound); // Invalida el logro de completar el juego sin entrar a la jail - const bool haveTheItems = board.items == 2; + const bool haveTheItems = board.items >= int(totalItems * 0.9f); if (!haveTheItems) { cheevos->invalidate(9); diff --git a/source/logo.cpp b/source/logo.cpp index 7c3d835..4dae51c 100644 --- a/source/logo.cpp +++ b/source/logo.cpp @@ -82,7 +82,7 @@ void Logo::checkEventHandler() } // Comprueba las teclas que se han pulsado - if ((eventHandler->type == SDL_KEYUP && eventHandler->key.repeat == 0) || (eventHandler->type == SDL_JOYBUTTONUP)) + if ((eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) || (eventHandler->type == SDL_JOYBUTTONUP)) { switch (eventHandler->key.keysym.scancode) {