-
-
Notifications
You must be signed in to change notification settings - Fork 855
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]: Wallclock mode minutes per year setting does not work correctly for values other than 0 and 12 #12154
Comments
Yikes! I changed this algorithm immediately before merge after using a different one for months, and apparently failed to properly test it. For anyone looking into this, here's the relevant code: https://github.com/OpenTTD/OpenTTD/blob/master/src/timer/timer_game_calendar.cpp#L106-L119 The original algorithm scaled the number of This whole algorithm probably needs to be rewritten from scratch, because it's broken in several ways. I will do some thinking about this, but if anyone else has any ideas, feel free to chime in! 🙂 |
Version of OpenTTD
master
Expected result
Wallclock mode minutes per year setting does what it says on the tin
Actual result
At minutes per year = 12, a calendar day is 74 ticks
At minutes per year = 13, a calendar day is 153 ticks
At minutes per year = 24, a calendar day is 221 ticks
TimerGameCalendar::sub_date_fract counts from 0 to ((74 * min_per_year) / 12) - 1
then date_fract counts from 0 to 74
Steps to reproduce
Use the minutes per year setting
The text was updated successfully, but these errors were encountered: