From: <au...@us...> - 2009-01-08 21:22:15
|
Revision: 2865 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=2865&view=rev Author: auria Date: 2009-01-08 21:22:05 +0000 (Thu, 08 Jan 2009) Log Message: ----------- fixed crash when finishing FTL GP Modified Paths: -------------- trunk/supertuxkart/src/race_manager.cpp Modified: trunk/supertuxkart/src/race_manager.cpp =================================================================== --- trunk/supertuxkart/src/race_manager.cpp 2009-01-08 18:25:40 UTC (rev 2864) +++ trunk/supertuxkart/src/race_manager.cpp 2009-01-08 21:22:05 UTC (rev 2865) @@ -314,6 +314,15 @@ 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 @@ 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; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |