summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-01-20 20:18:19 +0000
committerrubidium <rubidium@openttd.org>2012-01-20 20:18:19 +0000
commit70c7fbd90eb0ace75d759725ba4d0085283f152c (patch)
treef807e537b9e78dff6442d4ec2a472217e84157d4 /src/saveload
parent15331fa03c5bd87c54ea51e57a9738e867f6bc2e (diff)
downloadopenttd-70c7fbd90eb0ace75d759725ba4d0085283f152c.tar.xz
(svn r23826) -Fix [FS#4972]: the detailed performance rating window showed the cargo count of the current quarter instead of the last quarter like the tooltip says
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/company_sl.cpp7
-rw-r--r--src/saveload/oldloader_sl.cpp6
-rw-r--r--src/saveload/saveload.cpp3
3 files changed, 9 insertions, 7 deletions
diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp
index c1ce88870..836d20783 100644
--- a/src/saveload/company_sl.cpp
+++ b/src/saveload/company_sl.cpp
@@ -252,8 +252,8 @@ static const SaveLoad _company_desc[] = {
SLE_CONDVAR(CompanyProperties, avail_railtypes, SLE_UINT8, 0, 57),
SLE_VAR(CompanyProperties, block_preview, SLE_UINT8),
- SLE_CONDVAR(CompanyProperties, cargo_types, SLE_FILE_U16 | SLE_VAR_U32, 0, 93),
- SLE_CONDVAR(CompanyProperties, cargo_types, SLE_UINT32, 94, SL_MAX_VERSION),
+ SLE_CONDNULL(2, 0, 93), ///< cargo_types
+ SLE_CONDNULL(4, 94, 169), ///< cargo_types
SLE_CONDVAR(CompanyProperties, location_of_HQ, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
SLE_CONDVAR(CompanyProperties, location_of_HQ, SLE_UINT32, 6, SL_MAX_VERSION),
SLE_CONDVAR(CompanyProperties, last_build_coordinate, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
@@ -338,7 +338,8 @@ static const SaveLoad _company_economy_desc[] = {
SLE_CONDVAR(CompanyEconomyEntry, company_value, SLE_FILE_I32 | SLE_VAR_I64, 0, 1),
SLE_CONDVAR(CompanyEconomyEntry, company_value, SLE_INT64, 2, SL_MAX_VERSION),
- SLE_VAR(CompanyEconomyEntry, delivered_cargo, SLE_INT32),
+ SLE_CONDVAR(CompanyEconomyEntry, delivered_cargo[NUM_CARGO - 1], SLE_INT32, 0, 169),
+ SLE_CONDARR(CompanyEconomyEntry, delivered_cargo, SLE_UINT32, NUM_CARGO, 170, SL_MAX_VERSION),
SLE_VAR(CompanyEconomyEntry, performance_history, SLE_INT32),
SLE_END()
diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp
index 2f0bfead6..479ee206e 100644
--- a/src/saveload/oldloader_sl.cpp
+++ b/src/saveload/oldloader_sl.cpp
@@ -887,7 +887,7 @@ static bool LoadOldCompanyYearly(LoadgameState *ls, int num)
static const OldChunks _company_economy_chunk[] = {
OCL_SVAR( OC_FILE_I32 | OC_VAR_I64, CompanyEconomyEntry, income ),
OCL_SVAR( OC_FILE_I32 | OC_VAR_I64, CompanyEconomyEntry, expenses ),
- OCL_SVAR( OC_INT32, CompanyEconomyEntry, delivered_cargo ),
+ OCL_SVAR( OC_INT32, CompanyEconomyEntry, delivered_cargo[NUM_CARGO - 1] ),
OCL_SVAR( OC_INT32, CompanyEconomyEntry, performance_history ),
OCL_SVAR( OC_TTD | OC_FILE_I32 | OC_VAR_I64, CompanyEconomyEntry, company_value ),
@@ -931,8 +931,8 @@ static const OldChunks _company_chunk[] = {
OCL_SVAR( OC_FILE_U32 | OC_VAR_I64, Company, bankrupt_value ),
OCL_SVAR( OC_UINT16, Company, bankrupt_timeout ),
- OCL_SVAR( OC_TTD | OC_UINT32, Company, cargo_types ),
- OCL_SVAR( OC_TTO | OC_FILE_U16 | OC_VAR_U32, Company, cargo_types ),
+ OCL_CNULL( OC_TTD, 4 ), // cargo_types
+ OCL_CNULL( OC_TTO, 2 ), // cargo_types
OCL_CHUNK( 3, LoadOldCompanyYearly ),
OCL_CHUNK( 1, LoadOldCompanyEconomy ),
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 8a012b233..74274c1f4 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -233,8 +233,9 @@
* 167 23504
* 168 23637
* 169 23816
+ * 170 23826
*/
-extern const uint16 SAVEGAME_VERSION = 169; ///< Current savegame version of OpenTTD.
+extern const uint16 SAVEGAME_VERSION = 170; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading