Fix #9440: negative cargo payments not being handled right

Cargo payments were stored as unsigned integer, but cast to int64 during
application of inflation. However, then being multiplied with a uint64
making the result uint64. So in the end the payment that should have been
negative becomes hugely positive.
This commit is contained in:
Rubidium
2021-07-22 21:09:33 +02:00
committed by rubidium42
parent c1d79398d5
commit d83647f9a7
3 changed files with 3 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ struct Economy {
uint32 industry_daily_change_counter; ///< Bits 31-16 are number of industry to be performed, 15-0 are fractional collected daily
uint32 industry_daily_increment; ///< The value which will increment industry_daily_change_counter. Computed value. NOSAVE
uint64 inflation_prices; ///< Cumulated inflation of prices since game start; 16 bit fractional part
uint64 inflation_payment; ///< Cumulated inflation of cargo paypent since game start; 16 bit fractional part
uint64 inflation_payment; ///< Cumulated inflation of cargo payment since game start; 16 bit fractional part
/* Old stuff for savegame conversion only */
Money old_max_loan_unround; ///< Old: Unrounded max loan