From: Holger Schemel Date: Mon, 25 Jul 2022 17:24:54 +0000 (+0200) Subject: added overwriting local with server score entries to add missing fields X-Git-Tag: 4.3.3.0~79 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=03a494c7a4afcd22849d3c0f42193ded57fdc700;p=rocksndiamonds.git added overwriting local with server score entries to add missing fields --- 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; }