No option to abort grand prix on last track (#3003)

* Small clarification to prevent build errors

Building outside of this directory prevents the executable from launching, this small addition can help prevent this issue from happening.

* Initial Commit

* Code cleanup

* Fix compile error

* Fix incorrect comparison
This commit is contained in:
Ben Krajancic 2017-11-01 10:15:57 +11:00 committed by auriamg
parent 2cc160d7cc
commit a94d22cce7
2 changed files with 7 additions and 2 deletions

View File

@ -613,6 +613,8 @@ public:
// ------------------------------------------------------------------------
int getTrackNumber() const { return m_track_number; }
// ------------------------------------------------------------------------
int getNumOfTracks() const { return (int)m_tracks.size(); }
// ------------------------------------------------------------------------
/** Returns the list of AI karts to use. Used for networking, and for
* the --ai= command line option. */
const std::vector<std::string>& getAIKartList() const

View File

@ -205,8 +205,11 @@ void RaceResultGUI::enableAllButtons()
middle->setText(_("Continue"));
middle->setVisible(true);
bottom->setText(_("Abort Grand Prix"));
bottom->setVisible(true);
if (race_manager->getTrackNumber() + 1 < race_manager->getNumOfTracks())
{
bottom->setText(_("Abort Grand Prix"));
bottom->setVisible(true);
}
middle->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
}