If the number of laps used previously (or set via a command line

option) was too small, a leader could 'finish' the race, and while
no message would be printed, its distance calcuation become incorrect.
To workd around this issue (and to avoid making the code in
linear_world even more convoluted) I just set a large number
for the number of laps in case of a FTL race.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5998 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-09-14 05:21:55 +00:00
parent 2665dd2e5d
commit 5fc601c9d9

View File

@ -28,6 +28,12 @@
//-----------------------------------------------------------------------------
FollowTheLeaderRace::FollowTheLeaderRace() : LinearWorld()
{
// We have to make sure that no kart finished the set number of laps
// in a FTL race (since otherwise its distance will not be computed
// correctly, and as a result e.g. a leader might suddenly fall back
// after crossing the start line
race_manager->setNumLaps(99999);
m_leader_intervals = stk_config->m_leader_intervals;
m_use_highscores = false; // disable high scores
setClockMode(WorldStatus::CLOCK_COUNTDOWN, m_leader_intervals[0]);