diff options
author | Rubidium <rubidium@openttd.org> | 2021-07-22 21:09:33 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-08-02 20:44:53 +0200 |
commit | d83647f9a7aaa2adb5ffa1042613f256134a9e1d (patch) | |
tree | 07c791291bcc9cd35709abc25745ec74df5b026c /src/cargotype.h | |
parent | c1d79398d57b4b8a013fcca62e72a5ce9efc137f (diff) | |
download | openttd-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/cargotype.h')
-rw-r--r-- | src/cargotype.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cargotype.h b/src/cargotype.h index a398d6079..5ed9ac90e 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -61,7 +61,7 @@ struct CargoSpec { uint8 rating_colour; uint8 weight; ///< Weight of a single unit of this cargo type in 1/16 ton (62.5 kg). uint16 multiplier; ///< Capacity multiplier for vehicles. (8 fractional bits) - uint32 initial_payment; ///< Initial payment rate before inflation is applied. + int32 initial_payment; ///< Initial payment rate before inflation is applied. uint8 transit_days[2]; bool is_freight; ///< Cargo type is considered to be freight (affects train freight multiplier). |