Changeset - r17825:d7517e40e058
[Not reviewed]
master
0 3 0
frosch - 13 years ago 2011-07-03 10:59:25
frosch@openttd.org
(svn r22626) -Fix [FS#4622]: Also initialise _old_vds with newgame settings; TTD savegames do not contain these settings.
3 files changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/openttd.cpp
Show inline comments
 
@@ -311,13 +311,16 @@ void MakeNewgameSettingsLive()
 
		if (_settings_game.ai_config[c] != NULL) {
 
			delete _settings_game.ai_config[c];
 
		}
 
	}
 
#endif /* ENABLE_AI */
 

	
 
	/* Copy newgame settings to active settings.
 
	 * Also initialise old settings needed for savegame conversion. */
 
	_settings_game = _settings_newgame;
 
	_old_vds = _settings_client.company.vehicle;
 

	
 
#ifdef ENABLE_AI
 
	for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
 
		_settings_game.ai_config[c] = NULL;
 
		if (_settings_newgame.ai_config[c] != NULL) {
 
			_settings_game.ai_config[c] = new AIConfig(_settings_newgame.ai_config[c]);
src/settings_internal.h
Show inline comments
 
@@ -90,9 +90,7 @@ typedef SettingDesc SettingDescGlobVarLi
 

	
 
const SettingDesc *GetSettingFromName(const char *name, uint *i);
 
bool SetSettingValue(uint index, int32 value, bool force_newgame = false);
 
bool SetSettingValue(uint index, const char *value, bool force_newgame = false);
 
void SetCompanySetting(uint index, int32 value);
 

	
 
extern VehicleDefaultSettings _old_vds;
 

	
 
#endif /* SETTINGS_INTERNAL_H */
src/settings_type.h
Show inline comments
 
@@ -462,12 +462,15 @@ extern ClientSettings _settings_client;
 
/** The current settings for this game. */
 
extern GameSettings _settings_game;
 

	
 
/** The settings values that are used for new games and/or modified in config file. */
 
extern GameSettings _settings_newgame;
 

	
 
/** Old vehicle settings, which were game settings before, and are company settings now. (Needed for savegame conversion) */
 
extern VehicleDefaultSettings _old_vds;
 

	
 
/**
 
 * Get the settings-object applicable for the current situation: the newgame settings
 
 * when we're in the main menu and otherwise the settings of the current game.
 
 */
 
static inline GameSettings &GetGameSettings()
 
{
0 comments (0 inline, 0 general)