]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
autodemo delete feature for race (sets cl_autodemo_delete to 3 if
authorFruitieX <rasse@rasse-lappy.localdomain>
Sun, 2 May 2010 07:39:58 +0000 (10:39 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sun, 2 May 2010 07:39:58 +0000 (10:39 +0300)
there's a record)

qcsrc/client/sbar.qc

index 2b06979413cb6906dd920c8f54ef78bfcaf78c5c..304d0a681b0fd025e9f6b577f00d435ffee06f54 100644 (file)
@@ -3395,8 +3395,11 @@ void CSQC_race_hud(void)
                rr = RACE_RECORD;
        t = stof(db_get(ClientProgsDB, strcat(shortmapname, rr, "time")));
 
-       if(score && score < t || !t)
+       if(score && (score < t || !t)) {
                db_put(ClientProgsDB, strcat(shortmapname, rr, "time"), ftos(score));
+               if(cvar("cl_autodemo_delete"))
+                       cvar_set("cl_autodemo_delete", "3"); // don't delete demo with new record!
+       }
 
        if(t != crecordtime_prev) {
                crecordtime_prev = t;