Skip to content
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

terraform_frame_burst (and similar settings) are stored to 16-bit integers instead of 32 bits. #8610

James103 opened this issue Jan 26, 2021 · 1 comment · Fixed by #8780


Copy link

@James103 James103 commented Jan 26, 2021

Version of OpenTTD

1.11.0 beta 1

Expected result

set terraform_frame_burst 131071 should set terraform_frame_burst to 131071. The setting is stored as a 32-bit int.

Actual result

set terraform_frame_burst 131071 sets terraform_frame_burst to 65535 due to a 16-bit unsigned integer overflow.

Steps to reproduce:

Run the following console commands and notice the output:

set terraform_frame_burst
set terraform_frame_burst 131071
set terraform_frame_burst
Copy link

@TrueBrain TrueBrain commented Mar 1, 2021

I looked at this ticket a few times, and did not really understand what you meant. But now with the fast-foward limiter setting, I get it. It is not so much that the value should be stored in 32-bit, rather that the maximum value was higher than the storage size. That makes sense :) So limiting the maximum value to be within the 16-bit size also solves the problem; as it was never possible to exceed it anyway, that doesn't give a regression, and avoids a savegame bump :D

@TrueBrain TrueBrain removed the needs triage label Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging a pull request may close this issue.

2 participants