Fixed compiler warnings and comments.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11732 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2012-10-21 23:03:08 +00:00
parent 3a6133f6d6
commit 68711524bf

View File

@ -636,8 +636,8 @@ void LinearWorld::updateRacePosition()
int p = 1 ; int p = 1 ;
const int my_id = kart->getWorldKartId(); const unsigned int my_id = kart->getWorldKartId();
const float my_distance = m_kart_info[my_id].m_overall_distance; const float my_distance = m_kart_info[my_id].m_overall_distance;
// Count karts ahead of the current kart, i.e. kart that are // Count karts ahead of the current kart, i.e. kart that are
// already finished or have covered a larger overall distance. // already finished or have covered a larger overall distance.
@ -648,12 +648,14 @@ void LinearWorld::updateRacePosition()
continue; continue;
// If the other kart has: // If the other kart has:
// - finished the race, or is ahead, or has the same distance // - finished the race (but this kart hasn't)
// but started earlier, it is ahead --> increase position // - or is ahead
if(!kart->hasFinishedRace() && m_karts[j]->hasFinishedRace() || // - or has the same distance (very unlikely) but started earlier
m_kart_info[j].m_overall_distance > my_distance || // it is ahead --> increase position
(m_kart_info[j].m_overall_distance == my_distance && if((!kart->hasFinishedRace() && m_karts[j]->hasFinishedRace()) ||
m_karts[j]->getInitialPosition()<kart->getInitialPosition() ) ) m_kart_info[j].m_overall_distance > my_distance ||
(m_kart_info[j].m_overall_distance == my_distance &&
m_karts[j]->getInitialPosition()<kart->getInitialPosition() ) )
{ {
p++; p++;
} }