From 4db7c4f549e2a30236052db08ceb31cf4d7f0131 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 7 Jul 2008 09:23:54 +0000 Subject: (svn r13679) -Fix [FS#2131]: saving TTD imported games in recession failed due to wrong (and unneeded) type conversions in the saveload code. --- src/economy.cpp | 2 +- src/economy_type.h | 2 +- src/oldloader.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/economy.cpp b/src/economy.cpp index 4e9d85c9b..30180cee2 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1909,7 +1909,7 @@ static const SaveLoad _economy_desc[] = { SLE_CONDVAR(Economy, max_loan_unround, SLE_FILE_I32 | SLE_VAR_I64, 0, 64), SLE_CONDVAR(Economy, max_loan_unround, SLE_INT64, 65, SL_MAX_VERSION), SLE_CONDVAR(Economy, max_loan_unround_fract, SLE_UINT16, 70, SL_MAX_VERSION), - SLE_VAR(Economy, fluct, SLE_FILE_I16 | SLE_VAR_I32), + SLE_VAR(Economy, fluct, SLE_INT16), SLE_VAR(Economy, interest_rate, SLE_UINT8), SLE_VAR(Economy, infl_amount, SLE_UINT8), SLE_VAR(Economy, infl_amount_pr, SLE_UINT8), diff --git a/src/economy_type.h b/src/economy_type.h index ae00296ea..f516e57ef 100644 --- a/src/economy_type.h +++ b/src/economy_type.h @@ -15,7 +15,7 @@ struct Economy { Money max_loan; ///< Maximum possible loan Money max_loan_unround; ///< Economy fluctuation status uint16 max_loan_unround_fract; ///< Fraction of the unrounded max loan - int fluct; + int16 fluct; byte interest_rate; ///< Interest byte infl_amount; ///< inflation amount byte infl_amount_pr; ///< inflation rate for payment rates diff --git a/src/oldloader.cpp b/src/oldloader.cpp index 124efe4f3..90ec6ef79 100644 --- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -1563,7 +1563,7 @@ static const OldChunks main_chunk[] = { OCL_VAR ( OC_FILE_U32 | OC_VAR_I64, 1, &_economy.max_loan ), OCL_VAR ( OC_FILE_U32 | OC_VAR_I64, 1, &_economy.max_loan_unround ), - OCL_VAR ( OC_FILE_U16 | OC_VAR_U32, 1, &_economy.fluct ), + OCL_VAR ( OC_INT16, 1, &_economy.fluct ), OCL_VAR ( OC_UINT16, 1, &_disaster_delay ), -- cgit v1.2.3-70-g09d2