]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
CTS: show spectators who set a time grayed out terencehill/cts_stats_fix 1004/head
authorterencehill <piuntn@gmail.com>
Sat, 17 Jun 2023 23:19:46 +0000 (01:19 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 17 Jun 2023 23:19:46 +0000 (01:19 +0200)
qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc

index 52e2d09732cd8842364b197733928faf3c7c9843..27efb10f1ef3d0cd52623efa12afd234c4d0b23a 100644 (file)
@@ -72,6 +72,11 @@ void cts_EventLog(string mode, entity actor) // use an alias for easy changing a
                GameLogEcho(strcat(":cts:", mode, ":", ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
 }
 
+bool cts_isEliminated(entity e)
+{
+       return ((IS_SPEC(e) || IS_OBSERVER(e)) && e.frags == FRAGS_PLAYER_OUT_OF_GAME);
+}
+
 MUTATOR_HOOKFUNCTION(cts, PlayerPhysics)
 {
        entity player = M_ARGV(0, entity);
@@ -199,6 +204,7 @@ MUTATOR_HOOKFUNCTION(cts, MakePlayerObserver)
                player.frags = FRAGS_PLAYER_OUT_OF_GAME;
        else
                player.frags = FRAGS_SPECTATOR;
+       eliminatedPlayers.SendFlags |= 1;
 
        race_PreparePlayer(player);
        player.race_checkpoint = -1;
@@ -235,6 +241,7 @@ MUTATOR_HOOKFUNCTION(cts, PutClientInServer)
 
                race_AbandonRaceCheck(player);
        }
+       eliminatedPlayers.SendFlags |= 1;
 }
 
 MUTATOR_HOOKFUNCTION(cts, PlayerDamaged)
@@ -376,4 +383,5 @@ void cts_Initialize()
 {
        record_type = CTS_RECORD;
        cts_ScoreRules();
+       EliminatedPlayers_Init(cts_isEliminated);
 }