From 8690e55ceeb74b13d867e3cdfb9ee991b58b297a Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 18 Feb 2022 18:56:18 +0100 Subject: [PATCH] merged code for reloading updated server scores --- src/screens.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/screens.c b/src/screens.c index de1c498f..bc28179a 100644 --- a/src/screens.c +++ b/src/screens.c @@ -5093,6 +5093,24 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, int num_page_entries = MIN(num_entries, NUM_MENU_ENTRIES_ON_SCREEN); boolean position_set_by_scrollbar = (dx == 999); + if (game_status == GAME_MODE_SCORES) + { + if (server_scores.updated) + { + // reload scores, using updated server score cache file + LoadLocalAndServerScore(scores.last_level_nr, FALSE); + + server_scores.updated = FALSE; + + if (button != MB_MENU_INITIALIZE) + { + ti = setHallOfFameActiveEntry(ti_ptr); + + drawChooseTreeScreen(ti); + } + } + } + if (button == MB_MENU_INITIALIZE) { int num_entries = numTreeInfoInGroup(ti); @@ -5103,14 +5121,6 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, if (game_status == GAME_MODE_SCORES) { - if (server_scores.updated) - { - // reload scores, using updated server score cache file - LoadLocalAndServerScore(scores.last_level_nr, FALSE); - - server_scores.updated = FALSE; - } - ti = setHallOfFameActiveEntry(ti_ptr); } else if (ti->cl_first == -1) @@ -5482,18 +5492,6 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, } } - if (game_status == GAME_MODE_SCORES && server_scores.updated) - { - // reload scores, using updated server score cache file - LoadLocalAndServerScore(scores.last_level_nr, FALSE); - - server_scores.updated = FALSE; - - ti = setHallOfFameActiveEntry(ti_ptr); - - drawChooseTreeScreen(ti); - } - if (game_status == GAME_MODE_SCORES) PlayMenuSoundIfLoop(); } -- 2.34.1