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 2b06979..304d0a6 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;