From c30665dc619c9b8648c23c1b9c13d35f4b16a2ab Mon Sep 17 00:00:00 2001 From: auria Date: Thu, 8 Jan 2009 21:22:05 +0000 Subject: [PATCH] fixed crash when finishing FTL GP git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2865 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/race_manager.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/race_manager.cpp b/src/race_manager.cpp index 00a4ecb1b..a9225fda5 100644 --- a/src/race_manager.cpp +++ b/src/race_manager.cpp @@ -314,6 +314,15 @@ void RaceManager::exit_race() race_time[kart_id] = race_manager->getOverallTime(kart_id); } + if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_FOLLOW_LEADER) + { + // fill values for leader + position[0] = -1; + scores[0] = -1; + race_time[0] = -1; + m_kart_status[0].m_gp_final_rank = -1; + } + //Bubblesort bool sorted; do @@ -346,9 +355,10 @@ void RaceManager::exit_race() for(unsigned int i=start; i < NUM_KARTS; ++i) { - //printf("setting kart %s to rank %i\n", race_manager->getKartName(position[i]).c_str(), i); - m_kart_status[position[i]].m_gp_final_rank = i; + //printf("setting kart %s to rank %i\n", race_manager->getKartName(position[i]).c_str(), i-start); + m_kart_status[position[i]].m_gp_final_rank = i - start; } + // printf("kart %s has rank %i\n", 0, m_kart_status[0].m_gp_final_rank); delete []scores; delete []position; delete []race_time;