]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an event log print to replace player place message in console
authorMario <zacjardine@y7mail.com>
Thu, 13 Nov 2014 14:35:30 +0000 (01:35 +1100)
committerMario <zacjardine@y7mail.com>
Thu, 13 Nov 2014 14:35:30 +0000 (01:35 +1100)
qcsrc/server/mutators/gamemode_cts.qc
qcsrc/server/mutators/gamemode_race.qc

index 9be1dc542c8e5ce602e56bda43a1a7b2100353db..9c674d45d89933fa9f24e8bc13e31e7f2a7995d4 100644 (file)
@@ -43,6 +43,12 @@ void cts_ScoreRules()
        ScoreRules_basics_end();
 }
 
+void cts_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
+{
+       if(autocvar_sv_eventlog)
+               GameLogEcho(strcat(":cts:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+}
+
 MUTATOR_HOOKFUNCTION(cts_PlayerPhysics)
 {
        // force kbd movement for fairness
@@ -112,7 +118,7 @@ MUTATOR_HOOKFUNCTION(cts_ResetMap)
                        if(!s)
                                e.race_place = 0;
                }
-               print(e.netname, " = ", ftos(e.race_place), "\n");
+               cts_EventLog(ftos(e.race_place), e);
        }
 
        if(g_race_qualifying == 2)
index fd438d8d9394a96bd5950116a1da9520f5fdd5bb..da5ca4c10e9d23a89f347f3f6e5c306902144e18 100644 (file)
@@ -50,6 +50,12 @@ void race_ScoreRules()
        ScoreRules_basics_end();
 }
 
+void race_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
+{
+       if(autocvar_sv_eventlog)
+               GameLogEcho(strcat(":race:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+}
+
 MUTATOR_HOOKFUNCTION(race_PlayerPhysics)
 {
        // force kbd movement for fairness
@@ -119,7 +125,7 @@ MUTATOR_HOOKFUNCTION(race_ResetMap)
                        if(!s)
                                e.race_place = 0;
                }
-               print(e.netname, " = ", ftos(e.race_place), "\n");
+               race_EventLog(ftos(e.race_place), e);
        }
 
        if(g_race_qualifying == 2)