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 ;)
This commit is contained in:
Patric Stout 2021-01-07 08:55:35 +01:00 committed by Patric Stout
parent d9ec8053d7
commit a1987df96a

View File

@ -200,11 +200,13 @@ static void OnNewYear()
if (_cur_year == _settings_client.gui.semaphore_build_before) ResetSignalVariant(); if (_cur_year == _settings_client.gui.semaphore_build_before) ResetSignalVariant();
/* check if we reached end of the game (end of ending year) */ /* check if we reached end of the game (end of ending year); 0 = never */
if (_cur_year == _settings_game.game_creation.ending_year + 1) { if (_cur_year == _settings_game.game_creation.ending_year + 1 && _settings_game.game_creation.ending_year != 0) {
ShowEndGameChart(); ShowEndGameChart();
}
/* check if we reached the maximum year, decrement dates by a year */ /* 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; int days_this_year;
_cur_year--; _cur_year--;