summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-02-05 04:14:21 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-02-05 04:36:57 (GMT)
commit8f26e6d5bb7fec582624a38d435b547585699e5b (patch)
treea64523a339803d654c5e7987608166d3bbd9bf60
parent4fd247e04834a6033f1eba42e2493af1356ed34a (diff)
downloadgrv-8f26e6d5bb7fec582624a38d435b547585699e5b.zip
grv-8f26e6d5bb7fec582624a38d435b547585699e5b.tar.gz
grv-8f26e6d5bb7fec582624a38d435b547585699e5b.tar.bz2
grv-8f26e6d5bb7fec582624a38d435b547585699e5b.tar.xz
scoretbl: don't emit duplicate entries
-rw-r--r--scoretbl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/scoretbl.c b/scoretbl.c
index fb57489..2d62160 100644
--- a/scoretbl.c
+++ b/scoretbl.c
@@ -220,27 +220,29 @@ int highscore_write(FILE *f, uint8_t leave)
bests.total[i].endlvl+1, quote(bests.total[i].player));
if ( fputs(buffer, f) == EOF )
return -1;
- bests.total[i].upload &= leave;
}
+ bests.total[i].upload &= leave;
}
for ( i = 0 ; i < MAX_LEVEL ; i++ ) {
for ( j = 0 ; j < MAX_PER_LEVEL ; j++ ) {
- if ( bests.level[i].score[j].score )
+ if ( bests.level[i].score[j].score ) {
sprintf(buffer, "LS %" PRIx64 " %d %" PRId64 "\n",
bests.level[i].score[j].gameid,
i+1, bests.level[i].score[j].score);
- if ( fputs(buffer, f) == EOF )
- return -1;
+ if ( fputs(buffer, f) == EOF )
+ return -1;
+ }
bests.level[i].score[j].upload &= leave;
}
for ( j = 0 ; j < MAX_PER_LEVEL ; j++ ) {
- if ( bests.level[i].time_ms[j].time_ms != NO_TIME )
+ if ( bests.level[i].time_ms[j].time_ms != NO_TIME ) {
sprintf(buffer, "LT %" PRIx64 " %d %" PRId32 "\n",
bests.level[i].time_ms[j].gameid,
i+1, bests.level[i].time_ms[j].time_ms);
- if ( fputs(buffer, f) == EOF )
- return -1;
+ if ( fputs(buffer, f) == EOF )
+ return -1;
+ }
bests.level[i].time_ms[j].upload &= leave;
}
}