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:
@@ -803,7 +803,7 @@ void RecomputePrices()
|
||||
|
||||
/* Setup cargo payment */
|
||||
for (CargoSpec *cs : CargoSpec::Iterate()) {
|
||||
cs->current_payment = ((int64)cs->initial_payment * _economy.inflation_payment) >> 16;
|
||||
cs->current_payment = (cs->initial_payment * (int64)_economy.inflation_payment) >> 16;
|
||||
}
|
||||
|
||||
SetWindowClassesDirty(WC_BUILD_VEHICLE);
|
||||
|
Reference in New Issue
Block a user