Remove all saved data for specified GP during start new race.

Generally it shouldn't happen because the rule is one save per one GP, but it is possible with old config.xml files.
This commit is contained in:
Deve 2015-01-07 18:41:52 +01:00
parent cd9bd36520
commit b726b59427

View File

@ -376,18 +376,26 @@ void RaceManager::startNew(bool from_overworld)
init_gp_rank ++;
}
m_track_number = 0;
if (m_major_mode == MAJOR_MODE_GRAND_PRIX)
{
if (m_continue_saved_gp)
{
m_track_number = m_saved_gp->getNextTrack();
m_track_number = m_saved_gp->getNextTrack();
m_saved_gp->loadKarts(m_kart_status);
}
else if (m_saved_gp != NULL)
else
{
m_saved_gp->remove();
m_saved_gp = NULL;
m_track_number = 0;
while (m_saved_gp != NULL)
{
m_saved_gp->remove();
m_saved_gp = SavedGrandPrix::getSavedGP(
StateManager::get()
->getActivePlayerProfile(0)
->getUniqueID(),
m_grand_prix.getId(),
m_player_karts.size());
}
}
}