diff --git a/src/race/race_manager.cpp b/src/race/race_manager.cpp index bbd19602b..c50dcea16 100644 --- a/src/race/race_manager.cpp +++ b/src/race/race_manager.cpp @@ -782,6 +782,7 @@ void RaceManager::exitRace(bool delete_world) } StateManager::get()->resetAndGoToScreen( MainMenuScreen::getInstance() ); + bool some_human_player_well_ranked = false; bool some_human_player_won = false; const unsigned int kart_status_count = (unsigned int)m_kart_status.size(); @@ -805,7 +806,9 @@ void RaceManager::exitRace(bool delete_world) if (m_kart_status[i].m_kart_type == KT_PLAYER || m_kart_status[i].m_kart_type == KT_NETWORK_PLAYER) { - some_human_player_won = true; + some_human_player_well_ranked = true; + if (rank == 0) + some_human_player_won = true; } } else if (rank >= loserThreshold) @@ -830,13 +833,14 @@ void RaceManager::exitRace(bool delete_world) race_manager->setNumKarts(0); race_manager->setNumPlayers(0); - if (some_human_player_won) + if (some_human_player_well_ranked) { race_manager->startSingleRace("gpwin", 999, race_manager->raceWasStartedFromOverworld()); GrandPrixWin* scene = GrandPrixWin::getInstance(); scene->push(); scene->setKarts(winners); + scene->setPlayerWon(some_human_player_won); } else { diff --git a/src/states_screens/grand_prix_win.cpp b/src/states_screens/grand_prix_win.cpp index 4267df015..4454a5e10 100644 --- a/src/states_screens/grand_prix_win.cpp +++ b/src/states_screens/grand_prix_win.cpp @@ -113,6 +113,7 @@ GrandPrixWin::GrandPrixWin() : GrandPrixCutscene("grand_prix_win.stkgui") m_kart_node[i] = NULL; m_podium_steps[i] = NULL; } + m_player_won = false; } // GrandPrixWin // ------------------------------------------------------------------------------------- @@ -316,10 +317,11 @@ void GrandPrixWin::onUpdate(float dt) static int test_y = 0; - GUIEngine::getTitleFont()->draw(_("You completed the Grand Prix!"), - core::rect< s32 >( 0, test_y, w, h/10 ), - color, - true/* center h */, true /* center v */ ); + irr::core::stringw message = (m_player_won) ? _("You won the Grand Prix!") : + _("You completed the Grand Prix!"); + + GUIEngine::getTitleFont()->draw(message, core::rect< s32 >( 0, test_y, w, h/10 ), + color, true/* center h */, true /* center v */ ); } // onUpdate diff --git a/src/states_screens/grand_prix_win.hpp b/src/states_screens/grand_prix_win.hpp index 6632db599..a536cafe9 100644 --- a/src/states_screens/grand_prix_win.hpp +++ b/src/states_screens/grand_prix_win.hpp @@ -62,6 +62,9 @@ class GrandPrixWin : float m_podium_x[3], m_podium_y[3], m_podium_z[3]; + /** Used to display a different message if a player is 1st */ + bool m_player_won; + public: // implement callbacks from parent class GUIEngine::Screen void init() OVERRIDE; @@ -72,6 +75,7 @@ public: /** \pre must be called after pushing the screen, but before onUpdate had the chance to be invoked */ void setKarts(const std::string idents[3]); + void setPlayerWon(bool some_player_won) { m_player_won = some_player_won; } }; #endif