From: Holger Schemel Date: Wed, 16 Mar 2022 16:22:43 +0000 (+0100) Subject: added filling visible high score list with empty score entries, if needed X-Git-Tag: 4.3.2.0~72 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=662dab9ed2a9ccc33076f83c9f16d68d9d37a3fb;p=rocksndiamonds.git added filling visible high score list with empty score entries, if needed --- diff --git a/src/screens.c b/src/screens.c index 8b70372f..d208c3a4 100644 --- a/src/screens.c +++ b/src/screens.c @@ -5713,6 +5713,7 @@ void HandleChooseLevelNr(int mx, int my, int dx, int dy, int button) static void DrawHallOfFame_setScoreEntries(void) { + int num_visible_score_entries = NUM_MENU_ENTRIES_ON_SCREEN - 1; int score_pos = (scores.last_added >= 0 ? scores.last_added : 0); int i; @@ -5725,9 +5726,10 @@ static void DrawHallOfFame_setScoreEntries(void) for (i = 0; i < MAX_SCORE_ENTRIES; i++) { - // do not add empty score entries + // do not add empty score entries if off-screen if (scores.entry[i].score == 0 && - scores.entry[i].time == 0) + scores.entry[i].time == 0 && + i >= num_visible_score_entries) break; TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_SCORE_ENTRY);