]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Refactor write_recordmarker to reduce engine function calls and while at it indent...
authorterencehill <piuntn@gmail.com>
Fri, 30 Aug 2024 14:21:32 +0000 (16:21 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 30 Aug 2024 14:23:53 +0000 (16:23 +0200)
qcsrc/server/race.qc

index 2430a6cbddb7801772797e32482d24bf7d7536f9..078f9e1923a7bf300adb9ec879d790e59567693d 100644 (file)
@@ -56,13 +56,11 @@ string uid2name(string myuid)
 
 void write_recordmarker(entity pl, 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), false)),
-                 " ", ftos(tstart), " ", ftos(dt), "\n"));
+       GameLogEcho(strcat(":recordset:", ftos(pl.playerid), ":", ftos(dt)));
+       // also write a marker into demo files for demotc-race-record-extractor to find
+       stuffcmd(pl,
+               sprintf("//%s RECORD SET %s %f %f\n", strconv(2, 0, 0, GetGametype()),
+                       TIME_ENCODED_TOSTRING(TIME_ENCODE(dt), false), tstart, dt));
 }
 
 IntrusiveList g_race_targets;