From: morosophos Date: Thu, 1 Nov 2018 00:04:47 +0000 (+0200) Subject: Do not write zero/empty records to cts db X-Git-Tag: xonotic-v0.8.5~1717^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d333a28773e185df197fd248bacdf1e77aa7cce6;p=xonotic%2Fxonotic-data.pk3dir.git Do not write zero/empty records to cts db --- diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 5286032fb..603b32a80 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -84,8 +84,11 @@ void race_writeTime(string map, float t, string myuid) // player has no ranked record yet for (i = RANKINGS_CNT; i > newpos; --i) { - db_put(ServerProgsDB, strcat(map, rr, "time", ftos(i)), ftos(race_readTime(map, i - 1))); - db_put(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(i)), race_readUID(map, i - 1)); + float other_time = race_readTime(map, i - 1); + if (other_time) { + db_put(ServerProgsDB, strcat(map, rr, "time", ftos(i)), ftos(other_time)); + db_put(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(i)), race_readUID(map, i - 1)); + } } }