From 3372c32ede11442a8b00304445ed3bb9bcf41f23 Mon Sep 17 00:00:00 2001 From: Morosophos Date: Mon, 12 Oct 2020 10:59:58 +0300 Subject: [PATCH] Include demo markers for anonymous records too --- qcsrc/server/race.qc | 18 +++++++++++++----- qcsrc/server/race.qh | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 03bb7aadbb..18c48671dd 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -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; diff --git a/qcsrc/server/race.qh b/qcsrc/server/race.qh index 9dd37a89e1..0156d14d4d 100644 --- a/qcsrc/server/race.qh +++ b/qcsrc/server/race.qh @@ -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); -- 2.39.5