Re #313 (Split Windows installer) Make SD work with only 1 track

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3303 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 9ef8ae39e52fb214074d1963d4cef11e119c41f8
Former-commit-id: cc0f1bd16b865c21de062f56b88b2e6371e0587e
This commit is contained in:
pouillot 2011-02-02 22:36:28 +00:00
parent a9caf2eb92
commit 078f3bfbda
4 changed files with 9 additions and 7 deletions

View file

@ -136,7 +136,7 @@ reOnRaceDataChanged()
{
const GfRaceManager* pRaceMan = ReGetRace()->getManager();
// Get the current track.
// Get the currently selected track for the race (should never fail, unless no track at all).
const GfTrack* pTrack = ReGetRace()->getTrack();
// Set title (race type + track name).

View file

@ -316,9 +316,10 @@ GfTrack* GfRaceManager::getCurrentEventTrack()
{
GfTrack* pTrack;
// If the current event track is not usable, step to the next event (an so on).
while (!(pTrack = GfTracks::self()->getTrack(_vecEventTrackIds[_nCurrentEventInd]))
&& stepToNextEvent());
// If the current event track is not usable, take the first usable one.
pTrack = GfTracks::self()->getTrack(_vecEventTrackIds[_nCurrentEventInd]);
if (!pTrack)
pTrack = GfTracks::self()->getFirstUsableTrack();
return pTrack;
}

View file

@ -297,8 +297,9 @@ GfTrack* GfTracks::getFirstUsableTrack(const std::string& strCatId,
nSearchDir = nSearchDir > 0 ? +1 : -1;
// Check category.
if (std::find(_pPrivate->vecCatIds.begin(), _pPrivate->vecCatIds.end(), strCatId)
== _pPrivate->vecCatIds.end())
if (!strCatId.empty()
&& std::find(_pPrivate->vecCatIds.begin(), _pPrivate->vecCatIds.end(), strCatId)
== _pPrivate->vecCatIds.end())
{
GfLogError("GfTracks::getFirstUsableTrack : No such category %s\n", strCatId.c_str());
return 0;

View file

@ -113,7 +113,7 @@ public:
std::vector<std::string> getTrackIdsInCategory(const std::string& strCatId = "") const;
std::vector<std::string> getTrackNamesInCategory(const std::string& strCatId = "") const;
GfTrack* getFirstUsableTrack(const std::string& strCatId,
GfTrack* getFirstUsableTrack(const std::string& strCatId = "",
const std::string& strFromTrackId = "",
int nSearchDir = +1, bool bSkipFrom = false) const;
GfTrack* getFirstUsableTrack(const std::string& strFromCatId,