]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Include demo markers for anonymous records too
authorMorosophos <morosophos@teichisma.info>
Mon, 12 Oct 2020 07:59:58 +0000 (10:59 +0300)
committerMorosophos <morosophos@teichisma.info>
Mon, 12 Oct 2020 07:59:58 +0000 (10:59 +0300)
qcsrc/server/race.qc
qcsrc/server/race.qh

index 03bb7aadbbfa9ba6aff5b640ac42a8a4bf82ac40..18c48671dda7d88750500d36b4fcfbbd32c5d2e7 100644 (file)
@@ -51,15 +51,23 @@ string uid2name(string myuid)
        return s;
 }
 
-void write_recordmarker(entity pl, float tstart, float dt)
+void write_recordmarker(entity pl, float newpos, float tstart, float dt)
 {
     GameLogEcho(strcat(":recordset:", ftos(pl.playerid), ":", ftos(dt)));
 
     // also write a marker into demo files for demotc-race-record-extractor to find
-    stuffcmd(pl,
-             strcat(
-                 strcat("//", strconv(2, 0, 0, GetGametype()), " RECORD SET ", TIME_ENCODED_TOSTRING(TIME_ENCODE(dt))),
-                 " ", ftos(tstart), " ", ftos(dt), "\n"));
+    if (pl.crypto_idfp != "") {
+      stuffcmd(pl,
+               strcat(
+                   strcat("//", strconv(2, 0, 0, GetGametype()), " RECORD SET ", TIME_ENCODED_TOSTRING(TIME_ENCODE(dt))),
+                   strcat(" ", ftos(tstart), " ", ftos(dt), " ", ftos(newpos), " "),
+                   strcat(pl.crypto_idfp, "\n")));
+    } else {
+      stuffcmd(pl,
+               strcat(
+                   strcat("//", strconv(2, 0, 0, GetGametype()), " RECORD SET ", TIME_ENCODED_TOSTRING(TIME_ENCODE(dt))),
+                   strcat(" ", ftos(tstart), " ", ftos(dt), " ", ftos(newpos), " ANONYMOUS")));
+    }
 }
 
 IntrusiveList g_race_targets;
index 9dd37a89e1f8f9daa7eb53c93507987fab61f9f9..0156d14d4db8ba10c3db7205ebd6e91c55fe39ae 100644 (file)
@@ -34,7 +34,7 @@ float race_completing;
 .entity race_respawn_spotref; // try THIS spawn in case you respawn
 
 // definitions for functions used outside race.qc
-void write_recordmarker(entity pl, float tstart, float dt);
+void write_recordmarker(entity pl, float newpos, float tstart, float dt);
 
 float race_PreviousCheckpoint(float f);
 float race_NextCheckpoint(float f);