From 386b0badb6e869413ac936e043e2fdc104dfb9da Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 5 Dec 2023 17:10:37 +0000 Subject: [PATCH] Fix: Use newgame ending year on highscore table when not in a game. If ending year is set to never, then use the default end year instead. --- src/highscore_gui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index a6c9529af4..096d1bd6e8 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -189,7 +189,9 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { this->SetupHighScoreEndWindow(); Point pt = this->GetTopLeft(ScaleSpriteTrad(640), ScaleSpriteTrad(480)); - SetDParam(0, _settings_game.game_creation.ending_year); + TimerGameCalendar::Year year = _game_mode == GM_MENU ? _settings_newgame.game_creation.ending_year : _settings_game.game_creation.ending_year; + if (year == 0) year = CalendarTime::DEF_END_YEAR; // Use default ending year if configuration is set to never. + SetDParam(0, year); DrawStringMultiLine(pt.x + ScaleSpriteTrad(70), pt.x + ScaleSpriteTrad(570), pt.y, pt.y + ScaleSpriteTrad(140), !_networking ? STR_HIGHSCORE_TOP_COMPANIES_WHO_REACHED : STR_HIGHSCORE_TOP_COMPANIES_NETWORK_GAME, TC_FROMSTRING, SA_CENTER); /* Draw Highscore peepz */