New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Inflation breaks negative cargo payments #9440
Comments
Can you please check the cargo payment rates graph as well pre- and post-inflation and post your findings? |
rubidium42
added a commit
to rubidium42/OpenTTD
that referenced
this issue
Jul 22, 2021
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.
rubidium42
added a commit
that referenced
this issue
Aug 2, 2021
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of OpenTTD
OpenTTD 1.11.2, Windows 10
Expected result
My NewGRF industry set, Industries of the Caribbean, uses negative cargo rates set in the NML properties (not the profit callback, where a known issue exists).
When Inflation is disabled, this works as intended. A cargo delivery like that in the savegame attached below costs the company about -£50.
Actual result
When Inflation is enabled, that -£50 cargo delivery instead gives £205 million.
Steps to reproduce
A user provided this savegame illustrating the issue.
IOTC_inflation_bug.zip
When a new map is started with Inflation disabled and the same set of NewGRFs, the profit works as intended.
The text was updated successfully, but these errors were encountered: