]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add g_cts_cptimes_onlyself cvar (needed for XDWC)
authorMorosophos <morosophos@teichisma.info>
Mon, 12 Oct 2020 15:06:16 +0000 (18:06 +0300)
committerMorosophos <morosophos@teichisma.info>
Mon, 12 Oct 2020 15:06:16 +0000 (18:06 +0300)
qcsrc/server/race.qc
qcsrc/server/race.qh

index bc07efd5878f4e462b6ba6ba7248191efc4bc569..047f74f6180419b62eb0b077447e81590899e176 100644 (file)
@@ -215,11 +215,19 @@ void race_SendNextCheckpoint(entity e, float spec) // qualifying only
                return;
 
        int cp = e.race_checkpoint;
-       float recordtime = race_checkpoint_records[cp];
-       float myrecordtime = e.race_checkpoint_record[cp];
-       string recordholder = race_checkpoint_recordholders[cp];
-       if(recordholder == e.netname)
+        float myrecordtime = e.race_checkpoint_record[cp];
+        float recordtime;
+        string recordholder;
+        if (autocvar_g_cts_cptimes_onlyself) {
+          recordtime = myrecordtime;
+          recordholder = "";
+        } else {
+          recordtime = race_checkpoint_records[cp];
+
+         recordholder = race_checkpoint_recordholders[cp];
+         if(recordholder == e.netname)
                recordholder = "";
+        }
 
        if(!IS_REAL_CLIENT(e))
                return;
@@ -474,12 +482,17 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
 
                if(tvalid)
                {
-                       recordtime = race_checkpoint_records[cp];
-                       float myrecordtime = e.race_checkpoint_record[cp];
-                       recordholder = strcat1(race_checkpoint_recordholders[cp]); // make a tempstring copy, as we'll possibly strunzone it!
-                       if(recordholder == e.netname)
+                        float myrecordtime = e.race_checkpoint_record[cp];
+                        if (autocvar_g_cts_cptimes_onlyself) {
+                          recordtime = myrecordtime;
+                          recordholder = "";
+                        } else {
+                          recordtime = race_checkpoint_records[cp];
+                          recordholder = strcat1(race_checkpoint_recordholders[cp]); // make a tempstring copy, as we'll possibly strunzone it
+                          if(recordholder == e.netname)
                                recordholder = "";
 
+                        }
                        if(t != 0)
                        {
                                if(cp == race_timed_checkpoint)
index 9dd37a89e1f8f9daa7eb53c93507987fab61f9f9..45a7e211e1d5237260b1bace094495192e7fee47 100644 (file)
@@ -8,6 +8,7 @@ float race_teams;
 const float ST_RACE_LAPS = 1;
 
 int autocvar_g_cts_send_rankings_cnt = 15;
+bool autocvar_g_cts_cptimes_onlyself = false;
 
 bool g_race_qualifying;