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.
(cherry picked from commit d83647f9a7
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
e76c5dfda7
commit
230866ca3e
@@ -59,7 +59,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).
|
||||
|
Reference in New Issue
Block a user