]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
CA: Reset .team when a player chooses to spectate; remove ForbidPlayerScore_Clear... 364/head
authorterencehill <piuntn@gmail.com>
Sun, 4 Sep 2016 20:23:57 +0000 (22:23 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 4 Sep 2016 20:27:57 +0000 (22:27 +0200)
qcsrc/server/mutators/mutator/gamemode_ca.qc

index 4707e9fca0032114922da14f16756523b4bb596a..84f668bab5f9954db2cb331a8adef632fa894746 100644 (file)
@@ -277,25 +277,20 @@ MUTATOR_HOOKFUNCTION(ca, ClientDisconnect)
        return true;
 }
 
-MUTATOR_HOOKFUNCTION(ca, ForbidPlayerScore_Clear)
-{
-       return true;
-}
-
 MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
 {
     entity player = M_ARGV(0, entity);
 
        if (!IS_DEAD(player))
                ca_LastPlayerForTeam_Notify(player);
-       if (player.killindicator_teamchange == -2)
+       if (player.killindicator_teamchange == -2) // player wants to spectate
                player.caplayer = 0;
        if (player.caplayer)
                player.frags = FRAGS_LMS_LOSER;
-    else
-        player.frags = FRAGS_SPECTATOR;
        if (!warmup_stage)
                eliminatedPlayers.SendFlags |= 1;
+       if (!player.caplayer)
+               return false;  // allow team reset
        return true;  // prevent team reset
 }