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 9be1dc5..9c674d4 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 fd438d8..da5ca4c 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)