Go back to the overworld in losing challenges (#3192)

This commit is contained in:
Alayan-stk-2 2018-04-15 02:38:23 +02:00 committed by auriamg
parent 45aa9c2e3a
commit f16ed91bd5

View File

@ -387,17 +387,25 @@ void RaceResultGUI::eventCallback(GUIEngine::Widget* widget,
return;
}
// This is a normal race, nothing was unlocked
// -------------------------------------------
StateManager::get()->popMenu();
if (name == "top") // Setup new race
{
race_manager->exitRace();
race_manager->setAIKartOverride("");
Screen* newStack[] = { MainMenuScreen::getInstance(),
RaceSetupScreen::getInstance(),
NULL };
StateManager::get()->resetAndSetStack(newStack);
//If pressing continue quickly in a losing challenge
if (race_manager->raceWasStartedFromOverworld())
{
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
OverWorld::enterOverWorld();
}
else
{
Screen* newStack[] = { MainMenuScreen::getInstance(),
RaceSetupScreen::getInstance(),
NULL };
StateManager::get()->resetAndSetStack(newStack);
}
}
else if (name == "middle") // Restart
{