Make sure that next track is not higher than tracks size.

This commit is contained in:
Deve 2015-01-07 21:42:22 +01:00
parent 85800f48e6
commit 2b6ef130da

View File

@ -136,7 +136,9 @@ void GPInfoScreen::beforeAddingWidget()
m_gp.getId(),
race_manager->getNumLocalPlayers());
bool continue_visible = saved_gp && saved_gp->getNextTrack() > 0;
int tracks = m_gp.getTrackNames().size();
bool continue_visible = saved_gp && saved_gp->getNextTrack() > 0 &&
saved_gp->getNextTrack() < tracks;
RibbonWidget* ribbonButtons = getWidget<RibbonWidget>("buttons");
int id_continue_button = ribbonButtons->findItemNamed("continue");