From c1b151381527f6e0ae0d5b03096a63e34a27c1e1 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 3 Jul 2011 10:59:25 +0000 Subject: [PATCH] (svn r22626) -Fix [FS#4622]: Also initialise _old_vds with newgame settings; TTD savegames do not contain these settings. --- src/openttd.cpp | 3 +++ src/settings_internal.h | 2 -- src/settings_type.h | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/openttd.cpp b/src/openttd.cpp index 198e648fa0..6cf40ffba7 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -314,7 +314,10 @@ void MakeNewgameSettingsLive() } #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++) { diff --git a/src/settings_internal.h b/src/settings_internal.h index 5ada21eaaf..5c1d4adef9 100644 --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -93,6 +93,4 @@ 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 */ diff --git a/src/settings_type.h b/src/settings_type.h index 5179c7da8e..5ff4a0637a 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -465,6 +465,9 @@ 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.