I reproduced wrong kart rank issues again; adding more debug code to better track this bug
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5082 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
48a0c136f2
commit
723aff006e
@ -449,6 +449,8 @@ void LinearWorld::raceResultOrder( int order[] )
|
||||
{
|
||||
order[i] = -1;
|
||||
}
|
||||
|
||||
bool positions_ok = true;
|
||||
#endif
|
||||
|
||||
for (unsigned int i=0; i < NUM_KARTS; i++)
|
||||
@ -473,13 +475,18 @@ void LinearWorld::raceResultOrder( int order[] )
|
||||
}
|
||||
std::cout << "Kart " << i << " is being given posiiton " << (getKart(i)->getPosition()-1)
|
||||
<< ", but this position is already taken\n";
|
||||
assert(false);
|
||||
positions_ok = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// actually assign the position
|
||||
order[position] = i; // even for eliminated karts
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
assert(positions_ok);
|
||||
#endif
|
||||
|
||||
} // raceResultOrder
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -498,7 +498,7 @@ void World::updateHighscores()
|
||||
// the kart location data is wrong
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Error, incorrect kart positions:");
|
||||
fprintf(stderr, "Error, incorrect kart positions:\n");
|
||||
for (unsigned int i=0; i<m_karts.size(); i++ )
|
||||
{
|
||||
fprintf(stderr, "i=%d position %d\n",i, m_karts[i]->getPosition());
|
||||
|
Loading…
Reference in New Issue
Block a user