From 92b121a6b4b485d935c4bf7a76b19072acd3fee5 Mon Sep 17 00:00:00 2001 From: pouillot Date: Sun, 27 Feb 2011 15:36:41 +0000 Subject: [PATCH] Re #313 (Split Windows installer) Fixed Single event races not starting when 1 of the robots is not available git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3408 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 15d5d66a7da7459738b23f9cd969c89e509768cf Former-commit-id: 66a9ecbd20f09638c5b1efd76d7c29a130c82438 --- src/libs/raceengineclient/raceinit.cpp | 2 +- src/libs/tgfdata/race.cpp | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/libs/raceengineclient/raceinit.cpp b/src/libs/raceengineclient/raceinit.cpp index ea10a4510..9a047700a 100644 --- a/src/libs/raceengineclient/raceinit.cpp +++ b/src/libs/raceengineclient/raceinit.cpp @@ -760,7 +760,7 @@ ReInitCars(void) if (GfModLoad(CAR_IDENT, path, ReInfo->modList)) { GfLogError("Failed to load robot module %s\n", path); - break; + continue; } /* Load the racing driver info in the race data structure */ diff --git a/src/libs/tgfdata/race.cpp b/src/libs/tgfdata/race.cpp index 8dfb542ae..9e826ab95 100644 --- a/src/libs/tgfdata/race.cpp +++ b/src/libs/tgfdata/race.cpp @@ -130,6 +130,9 @@ void GfRace::load(GfRaceManager* pRaceMan, void* hparmResults) // Save the new race manager. _pPrivate->pRaceMan = pRaceMan; + // Now we should be consistent with the race params (in memory). + _pPrivate->bIsDirty = false; + // Check if usable, and exit if not. if (!_pPrivate->pRaceMan) return; @@ -412,6 +415,10 @@ void GfRace::load(GfRaceManager* pRaceMan, void* hparmResults) { GfLogWarning("Ignoring '%s' driver #%d : not found in available drivers\n", pszModName, nItfIndex); + + // We are no more consistent with the race params (in memory). + _pPrivate->bIsDirty = true; + continue; } @@ -421,6 +428,10 @@ void GfRace::load(GfRaceManager* pRaceMan, void* hparmResults) { GfLogWarning("Ignoring subsequent competitors (max=%u)\n", _pPrivate->nMaxCompetitors); + + // We are no more consistent with the race params (in memory). + _pPrivate->bIsDirty = true; + break; } @@ -466,6 +477,9 @@ void GfRace::load(GfRaceManager* pRaceMan, void* hparmResults) { GfLogWarning("Ignoring '%s' (%s' #%d) : Type or car category not accepted by the race\n", pCompetitor->getName().c_str(), pszModName, nItfIndex); + + // We are no more consistent with the race params (in memory). + _pPrivate->bIsDirty = true; } } @@ -474,9 +488,6 @@ void GfRace::load(GfRaceManager* pRaceMan, void* hparmResults) GfParmGetStr(hparmRaceMan, RM_SECT_DRIVERS, RM_ATTR_FOCUSED, ""); _pPrivate->nFocusedItfIndex = (int)GfParmGetNum(hparmRaceMan, RM_SECT_DRIVERS, RM_ATTR_FOCUSEDIDX, NULL, 0); - - // Now we are consistent with the race params (in memory). - _pPrivate->bIsDirty = false; } void GfRace::store()