This fixes a special case: If a score was not added to the local score
file (because all entries in the local score file have a better score,
and there are no free slots in the local score file anymore), the hall
of fame was completely skipped before. This was handled differently to
a score that was still not under the best 100 ranks on the high score
server for that level, but that was written to the local score file
(either because it was not full yet, or because it was better than the
last entry in the local score file).
This fix adds showing the score (with a rank of "???" on the last list
position, as usual) even if it was not written to the local score file.
void LoadLocalAndServerScore(int nr, boolean download_score)
{
int last_added_local = scores.last_added_local;
+ boolean force_last_added = scores.force_last_added;
// needed if only showing server scores
setScoreInfoToDefaults();
// merge local scores with scores from server
MergeServerScore();
}
+
+ if (force_last_added)
+ scores.force_last_added = force_last_added;
}
}
}
- return -1;
+ // special case: new score is beyond the last high score list position
+ return MAX_SCORE_ENTRIES;
}
void NewHighScore(int level_nr, boolean tape_saved)
scores.last_added = addScoreEntry(&scores, &new_entry, one_per_name);
+ if (scores.last_added >= MAX_SCORE_ENTRIES)
+ {
+ scores.last_added = MAX_SCORE_ENTRIES - 1;
+ scores.force_last_added = TRUE;
+
+ scores.entry[scores.last_added] = new_entry;
+
+ // store last added local score entry (before merging server scores)
+ scores.last_added_local = scores.last_added;
+
+ return;
+ }
+
if (scores.last_added < 0)
return;