Remove saved GPs only in offline mode during starting new race

This commit is contained in:
Deve 2015-01-07 21:19:04 +01:00
parent 2d9e38f7f6
commit 57ab9e5ac5

View File

@ -297,6 +297,8 @@ void RaceManager::startNew(bool from_overworld)
m_num_laps = m_grand_prix.getLaps();
m_reverse_track = m_grand_prix.getReverse();
if (!NetworkWorld::getInstance<NetworkWorld>()->isRunning())
{
// We look if Player 1 has a saved version of this GP.
m_saved_gp = SavedGrandPrix::getSavedGP(
StateManager::get()
@ -306,7 +308,7 @@ void RaceManager::startNew(bool from_overworld)
m_player_karts.size());
// Saved GP only in offline mode
if (m_continue_saved_gp && !NetworkWorld::getInstance<NetworkWorld>()->isRunning())
if (m_continue_saved_gp)
{
if (m_saved_gp == NULL)
{
@ -319,11 +321,13 @@ void RaceManager::startNew(bool from_overworld)
{
setNumKarts(m_saved_gp->getTotalKarts());
setupPlayerKartInfo();
m_grand_prix.changeReverse((GrandPrixData::GPReverseType)m_saved_gp->getReverseType());
m_grand_prix.changeReverse((GrandPrixData::GPReverseType)
m_saved_gp->getReverseType());
m_reverse_track = m_grand_prix.getReverse();
}
}
}
}
// command line parameters: negative numbers=all karts
if(m_num_karts < 0 ) m_num_karts = stk_config->m_max_karts;