From: Holger Schemel Date: Sun, 31 Oct 2021 00:05:43 +0000 (+0200) Subject: code cleanup X-Git-Tag: 4.3.0.0~3 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2c5088a81077574a04562bf9a1d3f590ee68623c;p=rocksndiamonds.git code cleanup --- diff --git a/src/game.c b/src/game.c index 4d1d9a85..3cdb836d 100644 --- a/src/game.c +++ b/src/game.c @@ -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)