From 03a494c7a4afcd22849d3c0f42193ded57fdc700 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 25 Jul 2022 19:24:54 +0200 Subject: [PATCH] added overwriting local with server score entries to add missing fields --- src/game.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game.c b/src/game.c index 4b7533ad..d7b6ad3d 100644 --- a/src/game.c +++ b/src/game.c @@ -5116,10 +5116,11 @@ static int addScoreEntry(struct ScoreInfo *list, struct ScoreEntry *new_entry, if (strEqual(new_entry->tape_basename, entry->tape_basename) && !strEqual(new_entry->tape_basename, UNDEFINED_FILENAME)) { - // special case: use server score instead of local score value if higher - // (historic scores might have been truncated to 16-bit values locally) - if (score_is_better) - entry->score = new_entry->score; + // add fields from server score entry not stored in local score entry + // (currently, this means setting platform, version and country fields; + // in rare cases, this may also correct an invalid score value, as + // historic scores might have been truncated to 16-bit values locally) + *entry = *new_entry; return -1; } -- 2.34.1