code cleanup
authorHolger Schemel <info@artsoft.org>
Sun, 31 Oct 2021 00:05:43 +0000 (02:05 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 31 Oct 2021 00:05:43 +0000 (02:05 +0200)
src/game.c

index 4d1d9a858244e4283d7bbbdf7f085ec5c4fc3b95..3cdb836d6764910ff3c28f8a359ebac8e03a128b 100644 (file)
@@ -5134,19 +5134,19 @@ void NewHighScore(int level_nr, boolean tape_saved)
 
   scores.last_added = addScoreEntry(&scores, &new_entry, one_per_name);
 
-  if (scores.last_added >= 0)
-  {
-    SaveScore(level_nr);
+  if (scores.last_added < 0)
+    return;
 
-    // store last added local score entry (before merging server scores)
-    scores.last_added_local = scores.last_added;
+  SaveScore(level_nr);
 
-    if (game.LevelSolved_SaveTape)
-    {
-      SaveScoreTape(level_nr);
-      SaveServerScore(level_nr, tape_saved);
-    }
-  }
+  // store last added local score entry (before merging server scores)
+  scores.last_added_local = scores.last_added;
+
+  if (!game.LevelSolved_SaveTape)
+    return;
+
+  SaveScoreTape(level_nr);
+  SaveServerScore(level_nr, tape_saved);
 }
 
 void MergeServerScore(void)