diff options
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 11 | ||||
-rw-r--r-- | src/saveload/oldloader_sl.cpp | 3 | ||||
-rw-r--r-- | src/saveload/saveload.cpp | 3 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 478717ff8..d969a40fc 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2803,6 +2803,17 @@ bool AfterLoadGame() } } + if (IsSavegameVersionBefore(184)) { + /* The global units configuration is split up in multiple configurations. */ + extern uint8 _old_units; + _settings_game.locale.units_velocity = Clamp(_old_units, 0, 2); + _settings_game.locale.units_power = Clamp(_old_units, 0, 2); + _settings_game.locale.units_weight = Clamp(_old_units, 1, 2); + _settings_game.locale.units_volume = Clamp(_old_units, 1, 2); + _settings_game.locale.units_force = 2; + _settings_game.locale.units_height = Clamp(_old_units, 0, 2); + } + /* Road stops is 'only' updating some caches */ AfterLoadRoadStops(); AfterLoadLabelMaps(); diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 791e63db5..f9215cf1d 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -1577,6 +1577,7 @@ extern uint16 _disaster_delay; extern byte _trees_tick_ctr; extern byte _age_cargo_skip_counter; // From misc_sl.cpp extern uint8 _old_diff_level; +extern uint8 _old_units; static const OldChunks main_chunk[] = { OCL_ASSERT( OC_TTD, 0 ), OCL_ASSERT( OC_TTO, 0 ), @@ -1705,7 +1706,7 @@ static const OldChunks main_chunk[] = { OCL_NULL( 1 ), ///< Station tick counter, no longer in use OCL_VAR ( OC_UINT8, 1, &_settings_game.locale.currency ), - OCL_VAR ( OC_UINT8, 1, &_settings_game.locale.units ), + OCL_VAR ( OC_UINT8, 1, &_old_units ), OCL_VAR ( OC_FILE_U8 | OC_VAR_U32, 1, &_cur_company_tick_index ), OCL_NULL( 2 ), ///< Date stuff, calculated automatically diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index 7b7d0342c..13129832b 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -249,8 +249,9 @@ * 181 25012 * 182 25296 * 183 25363 + * 184 xxxxx */ -extern const uint16 SAVEGAME_VERSION = 183; ///< Current savegame version of OpenTTD. +extern const uint16 SAVEGAME_VERSION = 184; ///< Current savegame version of OpenTTD. SavegameType _savegame_type; ///< type of savegame we are loading |