Fix for 940 - Race config corruption

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

Former-commit-id: d528674513afb815605e77feb9080470ccd099b5
Former-commit-id: 2d012fd5f56089d3267b462bf3123ecab8e3525f
This commit is contained in:
beaglejoe 2016-01-31 16:22:09 +00:00
parent 93d2fc77a6
commit e4231a9e6f

View file

@ -239,6 +239,7 @@ rmOnRaceDataChanged()
// Re-load competitors scroll list from the race.
GfuiScrollListClear(ScrHandle, CompetitorsScrollListId);
VecCompetitorsInfo.clear();
VecCompetitorsInfo.reserve(vecCompetitors.size());
for (int nCompIndex = 0; nCompIndex < (int)vecCompetitors.size(); nCompIndex++)
{
const GfDriver* pComp = vecCompetitors[nCompIndex];
@ -247,8 +248,12 @@ rmOnRaceDataChanged()
if (!pRaceMan->hasSubFiles()) // Don't show car name if Career mode (N/A here).
ossText << " (" << pComp->getCar()->getName() << ')';
VecCompetitorsInfo.push_back(ossText.str());
}
for (int nCompIndex = 0; nCompIndex < (int)vecCompetitors.size(); nCompIndex++)
{
const GfDriver* pComp = vecCompetitors[nCompIndex];
GfuiScrollListInsertElement(ScrHandle, CompetitorsScrollListId,
VecCompetitorsInfo.back().c_str(), nCompIndex+1, (void*)pComp);
VecCompetitorsInfo[nCompIndex].c_str(), nCompIndex+1, (void*)pComp);
//GfLogDebug("Added competitor %s (%s#%d)\n", ossText.str().c_str(),
// pComp->getModuleName().c_str(), pComp->getInterfaceIndex());
}