Changeset - r18237:ef265d83ffb7
[Not reviewed]
master
0 2 0
yexo - 13 years ago 2011-11-03 12:54:02
yexo@openttd.org
(svn r23083) -Fix: run StartupEngines() if NewGRFs changed during loading a savegame, just like it's running when NewGRFs are changed during a game
2 files changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/engine.cpp
Show inline comments
 
@@ -632,13 +632,16 @@ void StartupOneEngine(Engine *e, Date ag
 
	if (!HasBit(ei->climates, _settings_game.game_creation.landscape)) {
 
		e->flags |= ENGINE_AVAILABLE;
 
		e->company_avail = 0;
 
	}
 
}
 

	
 
/** Start/initialise all our engines. */
 
/**
 
 * Start/initialise all our engines. Must be called whenever there are changes
 
 * to the NewGRF config.
 
 */
 
void StartupEngines()
 
{
 
	Engine *e;
 
	/* Aging of vehicles stops, so account for that when starting late */
 
	const Date aging_date = min(_date, ConvertYMDToDate(_year_engine_aging_stops, 0, 1));
 

	
src/saveload/afterload.cpp
Show inline comments
 
@@ -2645,12 +2645,17 @@ bool AfterLoadGame()
 

	
 
				}
 
			}
 
		}
 
	}
 

	
 
	/* When any NewGRF has been changed the availability of some vehicles might
 
	 * have been changed too. e->company_avail must be set to 0 in that case
 
	 * which is done by StartupEngines(). */
 
	if (gcf_res != GLC_ALL_GOOD) StartupEngines();
 

	
 
	/* Road stops is 'only' updating some caches */
 
	AfterLoadRoadStops();
 
	AfterLoadLabelMaps();
 

	
 
	GamelogPrintDebug(1);
 

	
0 comments (0 inline, 0 general)