diff options
author | rubidium <rubidium@openttd.org> | 2013-06-29 09:47:18 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-06-29 09:47:18 +0000 |
commit | f9c9ff6ec3754ae7d36c64bff0a13bf8bda80bd8 (patch) | |
tree | ebcdd76048e5f65bc1fb0779866347b3c4f0a400 /src/saveload | |
parent | 6e97b7a6e81559f5e9fe3ccea2d1fda0095379c5 (diff) | |
download | openttd-f9c9ff6ec3754ae7d36c64bff0a13bf8bda80bd8.tar.xz |
(svn r25508) -Change: split unit localisation choice into a choice per type of unit, and move it to the advanced settings
-Feature [FS#5482]: have tractive effort in imperial (lbf) and metric (kgf) units
-Feature: have weights and volumes in imperial units (short tons, gallons)
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 |