From ad3bf48b0d007e9e2183a71276d20c46e3242f15 Mon Sep 17 00:00:00 2001 From: unitraxx Date: Sun, 26 May 2013 00:31:22 +0000 Subject: [PATCH] Small change to the checking of a saved GP. (First commit, don't shoot me if I did anything wrong.) git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12788 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/race/race_manager.cpp | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/race/race_manager.cpp b/src/race/race_manager.cpp index 277cc42ab..51fcc8b94 100644 --- a/src/race/race_manager.cpp +++ b/src/race/race_manager.cpp @@ -336,26 +336,27 @@ void RaceManager::startNew(bool from_overworld) init_gp_rank ++; } - - //We look if Player 1 has a saved version of this GP. - SavedGrandPrix* gp = SavedGrandPrix::getSavedGP( StateManager::get() - ->getActivePlayerProfile(0) - ->getUniqueID(), - m_grand_prix.getId(), - m_difficulty, - m_num_karts, - m_player_karts.size()); - - // Start the race with the appropriate track - // ========================================= - if(gp != NULL) + m_track_number = 0; + if(m_major_mode==MAJOR_MODE_GRAND_PRIX) { - m_track_number = gp->getNextTrack(); - gp->loadKarts(m_kart_status); - } - else - m_track_number = 0; + //We look if Player 1 has a saved version of this GP. + // ================================================= + SavedGrandPrix* gp = SavedGrandPrix::getSavedGP( StateManager::get() + ->getActivePlayerProfile(0) + ->getUniqueID(), + m_grand_prix.getId(), + m_difficulty, + m_num_karts, + m_player_karts.size()); + // Start the race with the appropriate track + // ========================================= + if(gp != NULL) + { + m_track_number = gp->getNextTrack(); + gp->loadKarts(m_kart_status); + } + } startNextRace(); } // startNew