From a1987df96acda0f58f88f2e154e26c529f59670b Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Thu, 7 Jan 2021 08:55:35 +0100 Subject: [PATCH] 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 ;) --- src/date.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/date.cpp b/src/date.cpp index 97758a3ebf..397d02c54a 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--;