(svn r21987) -Fix: Make news items, engine previews and AI preview events deal with no longer existing Engine items after resetting the pool.
This commit is contained in:
@@ -499,6 +499,7 @@ void SetCachedEngineCounts()
|
||||
|
||||
void SetupEngines()
|
||||
{
|
||||
DeleteWindowByClass(WC_ENGINE_PREVIEW);
|
||||
_engine_pool.CleanPool();
|
||||
|
||||
assert(_engine_mngr.Length() >= _engine_mngr.NUM_DEFAULT_ENGINES);
|
||||
@@ -859,6 +860,9 @@ void EnginesMonthlyLoop()
|
||||
CalcEngineReliability(e);
|
||||
}
|
||||
|
||||
/* Do not introduce invalid engines */
|
||||
if (!e->IsEnabled()) continue;
|
||||
|
||||
if (!(e->flags & ENGINE_AVAILABLE) && _date >= (e->intro_date + DAYS_IN_YEAR)) {
|
||||
/* Introduce it to all companies */
|
||||
NewVehicleAvailable(e);
|
||||
|
Reference in New Issue
Block a user