diff options
author | Patric Stout <truebrain@openttd.org> | 2021-01-07 08:55:35 +0100 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-01-08 11:17:08 +0100 |
commit | a1987df96acda0f58f88f2e154e26c529f59670b (patch) | |
tree | 1a862bbbfbebcd124ce0e02cdaebff7c66a4689a | |
parent | d9ec8053d7e545fd5b1b06760a592c1c0c07d103 (diff) | |
download | openttd-a1987df96acda0f58f88f2e154e26c529f59670b.tar.xz |
Fix #8050: never show the highscore when disabled, not even if you start in year zero
Using zero as "never" value can have its drawbacks ;)
-rw-r--r-- | src/date.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/date.cpp b/src/date.cpp index 97758a3eb..397d02c54 100644 --- a/src/date.cpp +++ b/src/date.cpp @@ -200,11 +200,13 @@ static void OnNewYear() if (_cur_year == _settings_client.gui.semaphore_build_before) ResetSignalVariant(); - /* check if we reached end of the game (end of ending year) */ - if (_cur_year == _settings_game.game_creation.ending_year + 1) { + /* check if we reached end of the game (end of ending year); 0 = never */ + if (_cur_year == _settings_game.game_creation.ending_year + 1 && _settings_game.game_creation.ending_year != 0) { ShowEndGameChart(); + } + /* check if we reached the maximum year, decrement dates by a year */ - } else if (_cur_year == MAX_YEAR + 1) { + if (_cur_year == MAX_YEAR + 1) { int days_this_year; _cur_year--; |