From 723aff006eab458e326300c7a4cce5bddb18da0a Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 27 Mar 2010 18:11:00 +0000 Subject: [PATCH] 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 --- src/modes/linear_world.cpp | 9 ++++++++- src/modes/world.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modes/linear_world.cpp b/src/modes/linear_world.cpp index 42db30ca8..308272727 100644 --- a/src/modes/linear_world.cpp +++ b/src/modes/linear_world.cpp @@ -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 //----------------------------------------------------------------------------- diff --git a/src/modes/world.cpp b/src/modes/world.cpp index a25b00c4b..d293c707e 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -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; igetPosition());