Revert "Properly ignore the leader in the ftl scoreboard"
(this patch only fixed the problem that happens when a non-leader is number one. By now the code has fixed that it is guaranteed that the leader is always number one, so this patch is not necessary anymore, and it complicates the loop). This reverts commit e9d78326fb6cc2222a46cd2bf1b2c90a4f30ec0a. Conflicts: src/states_screens/race_result_gui.cpp
This commit is contained in:
parent
3f468b254c
commit
6ada5a0666
@ -434,11 +434,13 @@ void RaceResultGUI::determineTableLayout()
|
|||||||
m_font->setMonospaceDigits(true);
|
m_font->setMonospaceDigits(true);
|
||||||
WorldWithRank *rank_world = (WorldWithRank*)World::getWorld();
|
WorldWithRank *rank_world = (WorldWithRank*)World::getWorld();
|
||||||
|
|
||||||
|
unsigned int first_position = 1;
|
||||||
|
if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_FOLLOW_LEADER)
|
||||||
|
first_position = 2;
|
||||||
|
|
||||||
// Use only the karts that are supposed to be displayed (and
|
// Use only the karts that are supposed to be displayed (and
|
||||||
// ignore e.g. the leader in a FTL race).
|
// ignore e.g. the leader in a FTL race).
|
||||||
unsigned int num_karts = race_manager->getNumberOfKarts();
|
unsigned int num_karts =race_manager->getNumberOfKarts()-first_position+1;
|
||||||
if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER)
|
|
||||||
num_karts--;
|
|
||||||
|
|
||||||
// In FTL races the leader kart is not displayed
|
// In FTL races the leader kart is not displayed
|
||||||
m_all_row_infos.resize(num_karts);
|
m_all_row_infos.resize(num_karts);
|
||||||
@ -450,21 +452,13 @@ void RaceResultGUI::determineTableLayout()
|
|||||||
m_width_kart_name = 0;
|
m_width_kart_name = 0;
|
||||||
float max_finish_time = 0;
|
float max_finish_time = 0;
|
||||||
|
|
||||||
for (int source_pos = 1, dest_pos = 0;
|
for(unsigned int position=first_position;
|
||||||
dest_pos < (int)num_karts; source_pos++, dest_pos++)
|
position<=race_manager->getNumberOfKarts(); position++)
|
||||||
{
|
{
|
||||||
const AbstractKart *kart = rank_world->getKartAtPosition(source_pos);
|
const AbstractKart *kart = rank_world->getKartAtPosition(position);
|
||||||
|
|
||||||
// Don't take the leader
|
|
||||||
if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER &&
|
|
||||||
kart == rank_world->getKart(0))
|
|
||||||
{
|
|
||||||
dest_pos--;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save a pointer to the current row_info entry
|
// Save a pointer to the current row_info entry
|
||||||
RowInfo *ri = &(m_all_row_infos[dest_pos]);
|
RowInfo *ri = &(m_all_row_infos[position-first_position]);
|
||||||
ri->m_is_player_kart = kart->getController()->isPlayerController();
|
ri->m_is_player_kart = kart->getController()->isPlayerController();
|
||||||
ri->m_kart_name = translations->fribidize(kart->getName());
|
ri->m_kart_name = translations->fribidize(kart->getName());
|
||||||
ri->m_player = ri->m_is_player_kart
|
ri->m_player = ri->m_is_player_kart
|
||||||
|
Loading…
x
Reference in New Issue
Block a user