fixed skipping historic score entries with empty tape basename
authorHolger Schemel <info@artsoft.org>
Wed, 12 May 2021 22:08:51 +0000 (00:08 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 12 May 2021 22:08:51 +0000 (00:08 +0200)
src/game.c

index 355acab2d1b4f952a04205d1f38a0e1303dce0dc..70aa13f400166aa87d9ba9c06801675f11a78cc8 100644 (file)
@@ -5066,7 +5066,9 @@ static int addScoreEntry(struct ScoreInfo *list, struct ScoreEntry *new_entry,
                              entry->time == 0);
 
     // prevent adding server score entries if also existing in local score file
-    if (strEqual(new_entry->tape_basename, entry->tape_basename))
+    // (special case: historic score entries have an empty tape basename entry)
+    if (strEqual(new_entry->tape_basename, entry->tape_basename) &&
+       !strEqual(new_entry->tape_basename, UNDEFINED_FILENAME))
       return -1;
 
     if (is_better || entry_is_empty)