]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Do not write zero/empty records to cts db 620/head
authormorosophos <ahcie0op@yandex.ru>
Thu, 1 Nov 2018 00:04:47 +0000 (02:04 +0200)
committermorosophos <ahcie0op@yandex.ru>
Thu, 1 Nov 2018 00:04:47 +0000 (02:04 +0200)
qcsrc/server/race.qc

index 5286032fb5715900836945008816d06f2e987241..603b32a80c288803f949da637c6ebd32436750e4 100644 (file)
@@ -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));
+                       }
                }
        }