summaryrefslogtreecommitdiff
path: root/src/economy_type.h
diff options
context:
space:
mode:
authorRubidium <rubidium@openttd.org>2021-07-22 21:09:33 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-08-02 20:44:53 +0200
commitd83647f9a7aaa2adb5ffa1042613f256134a9e1d (patch)
tree07c791291bcc9cd35709abc25745ec74df5b026c /src/economy_type.h
parentc1d79398d57b4b8a013fcca62e72a5ce9efc137f (diff)
downloadopenttd-d83647f9a7aaa2adb5ffa1042613f256134a9e1d.tar.xz
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.
Diffstat (limited to 'src/economy_type.h')
-rw-r--r--src/economy_type.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/economy_type.h b/src/economy_type.h
index 85a1bbe4f..1cb43b8ee 100644
--- a/src/economy_type.h
+++ b/src/economy_type.h
@@ -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