1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-28 17:09:10 +00:00

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.
This commit is contained in:
2023-12-05 17:10:37 +00:00
parent c0ea0589b4
commit 386b0badb6

View File

@@ -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 */