Merge pull request 'racemanagers.cpp: Do not list championship on no cars' (#22) from xavi/speed-dreams-code:fix-championship into main
Reviewed-on: #22
This commit is contained in:
commit
4776e34329
2 changed files with 22 additions and 4 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 9749171cef65b4bc93094df17fcf2ec79e8d187a
|
Subproject commit 53904d8e2c9c34e78d2c7be1bdb89becbe4cc6a7
|
|
@ -124,14 +124,32 @@ GfRaceManagers::GfRaceManagers()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool insert = false;
|
||||||
// Create the race manager and load it from the params file.
|
// Create the race manager and load it from the params file.
|
||||||
//GfLogDebug("GfRaceManagers::GfRaceManagers: creating '%s'\n", strRaceManId.c_str());
|
//GfLogDebug("GfRaceManagers::GfRaceManagers: creating '%s'\n", strRaceManId.c_str());
|
||||||
GfRaceManager* pRaceMan = new GfRaceManager(strRaceManId, hparmRaceMan);
|
GfRaceManager* pRaceMan = new GfRaceManager(strRaceManId, hparmRaceMan);
|
||||||
|
const std::vector<std::string>& catIds =
|
||||||
|
pRaceMan->getAcceptedCarCategoryIds();
|
||||||
|
|
||||||
|
for (const std::string &category : catIds)
|
||||||
|
{
|
||||||
|
std::vector<GfCar *> cars =
|
||||||
|
GfCars::self()->getCarsInCategory(category);
|
||||||
|
|
||||||
|
if (!cars.empty())
|
||||||
|
{
|
||||||
|
insert = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (insert)
|
||||||
|
{
|
||||||
// Update the GfRaceManagers singleton.
|
// Update the GfRaceManagers singleton.
|
||||||
_pPrivate->vecRaceMans.push_back(pRaceMan);
|
_pPrivate->vecRaceMans.push_back(pRaceMan);
|
||||||
_pPrivate->mapRaceMansById[strRaceManId] = pRaceMan;
|
_pPrivate->mapRaceMansById[strRaceManId] = pRaceMan;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
while ((pFile = pFile->next) != lstFiles);
|
while ((pFile = pFile->next) != lstFiles);
|
||||||
|
|
||||||
GfDirFreeList(lstFiles, NULL, true, true);
|
GfDirFreeList(lstFiles, NULL, true, true);
|
||||||
|
|
Loading…
Reference in a new issue