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
Scoring year is -1 when loading old savegame #8050
Comments
There's also another issue. Max year can go over 5000000:
|
There's yet another issue. Start year can be 0.
|
- Ending year could lead date to go over 5000000. - Never didn't work for year 0. - Loading old savegames could set the variable to a value outside the allowed range (-1).
as best as I can tell, _old_ending_year_slv_105 is never set, being left as default initialised to 0. The "old_ending_year_slv_105" setting has a default set to DEF_END_YEAR (2050, which is also wrong, as _old_ending... gets decremented before being used) but that's not being used at all. I don't know enough about the settings system to know how the defaults are supposed to work... |
While we're in the same area, Line 186 in 71e79ed
could do with being changed to the settings year (the newspaper sprite is still wrong, but one thing at a time...) |
- Ending year could lead date to go over 5000000. - Never didn't work for year 0. - Loading old savegames could set the variable to a value outside the allowed range (-1).
…00001 and beyond MAX_YEAR is set to 5000000, but having an ending-year set to the same meant you could bypass this, and play till the uint32 wrapped. The game can either show highscore or wrap year, not both. When you would do both, every year you get the highscore dialog. By changing the maximum value of ending-year to 4999999 we prevent this issue.
… you start in year zero Using zero as "never" value can have its drawbacks ;)
…nd beyond MAX_YEAR is set to 5000000, but having an ending-year set to the same meant you could bypass this, and play till the uint32 wrapped. The game can either show highscore or wrap year, not both. When you would do both, every year you get the highscore dialog. By changing the maximum value of ending-year to 4999999 we prevent this issue.
…art in year zero Using zero as "never" value can have its drawbacks ;)
Version of OpenTTD
1.10.0-RC1
Expected result
Set the old default scoring year
Actual result
scoring year is -1
Steps to reproduce
Load old savegame. I loaded "empty.sav", the regression savegame
The text was updated successfully, but these errors were encountered: