fix ordering of the karts and maybe some more
This commit is contained in:
parent
ae24c6b40f
commit
035fc599ee
@ -140,9 +140,15 @@ void SavedGrandPrix::setKarts(const std::vector<RaceManager::KartStatus> &kart_l
|
||||
}
|
||||
} // setKarts
|
||||
|
||||
/* compares two KartStatus-objects for std::sort in the next function */
|
||||
bool cmp__l(RaceManager::KartStatus first, RaceManager::KartStatus second)
|
||||
{
|
||||
return (first.m_score > second.m_score);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void SavedGrandPrix::loadKarts(std::vector<RaceManager::KartStatus> & kart_list)
|
||||
{
|
||||
|
||||
int aikarts = 0;
|
||||
for(unsigned int i = 0; i < m_karts.size(); i++)
|
||||
{
|
||||
@ -169,4 +175,6 @@ void SavedGrandPrix::loadKarts(std::vector<RaceManager::KartStatus> & kart_list)
|
||||
} // for x
|
||||
} // if m_local_player_id == -1
|
||||
} // for i
|
||||
|
||||
std::sort(kart_list.begin(), kart_list.end(), cmp__l);
|
||||
} // loadKarts
|
||||
|
@ -19,11 +19,13 @@
|
||||
#ifndef HEADER_SAVED_GRAND_PRIX_HPP
|
||||
#define HEADER_SAVED_GRAND_PRIX_HPP
|
||||
|
||||
#include <string>
|
||||
#include "config/user_config.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "utils/ptr_vector.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
class RaceManager;
|
||||
|
||||
// ============================================================================
|
||||
@ -151,7 +153,6 @@ public:
|
||||
return NULL;
|
||||
} // getSavedGP
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
}; // class SavedGrandPrix
|
||||
|
||||
#endif
|
||||
|
@ -362,7 +362,7 @@ void RaceManager::startNew(bool from_overworld)
|
||||
init_gp_rank ++;
|
||||
}
|
||||
|
||||
if (MAJOR_MODE_GRAND_PRIX)
|
||||
if (m_major_mode == MAJOR_MODE_GRAND_PRIX)
|
||||
{
|
||||
if (m_continue_saved_gp)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user