scores->num_entries = 0;
scores->last_added = -1;
+ scores->last_added_local = -1;
}
static void setScoreInfoToDefaults(void)
DownloadServerScoreToCache(nr);
LoadServerScoreFromCache(nr);
-
- MergeServerScore();
}
static char *get_file_base64(char *filename)
UploadScoreToServer(nr);
}
+void LoadLocalAndServerScore(int nr)
+{
+ int last_added_local = scores.last_added_local;
+
+ LoadScore(nr);
+
+ // restore last added local score entry (before merging server scores)
+ scores.last_added = scores.last_added_local = last_added_local;
+
+ LoadServerScore(nr);
+
+ MergeServerScore();
+}
+
// ============================================================================
// setup file functions
void LoadServerScore(int);
void SaveServerScore(int);
+void LoadLocalAndServerScore(int);
+
void LoadUserNames(void);
void LoadSetupFromFilename(char *);
SaveScoreTape(level_nr);
SaveServerScore(level_nr);
}
+
+ // store last added local score entry (before merging server scores)
+ scores.last_added_local = scores.last_added;
}
}
int num_entries;
int last_added;
+ int last_added_local;
struct ScoreEntry entry[MAX_SCORE_ENTRIES];
};
SetDrawDeactivationMask(REDRAW_NONE);
SetDrawBackgroundMask(REDRAW_FIELD);
- if (scores.last_added < 0)
- LoadScore(level_nr);
-
- LoadServerScore(level_nr);
+ LoadLocalAndServerScore(level_nr);
if (scores.last_added >= 0)
SetAnimStatus(GAME_MODE_PSEUDO_SCORESNEW);