]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
CA: fix 'spectate previous player' action not working in real spectator mode; it...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / clanarena / sv_clanarena.qc
index 9cd378f0fe6eacd521fe22e6f0bf3c5557b00ce5..686b0cbae06cddbf42a460a1ecae11a61f38b2fa 100644 (file)
@@ -298,7 +298,7 @@ MUTATOR_HOOKFUNCTION(ca, ClientDisconnect)
 {
        entity player = M_ARGV(0, entity);
 
-       if (player.caplayer == 1)
+       if (IS_PLAYER(player) && !IS_DEAD(player))
                ca_LastPlayerForTeam_Notify(player);
        return true;
 }
@@ -307,7 +307,7 @@ MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
 {
        entity player = M_ARGV(0, entity);
 
-       if (!IS_DEAD(player))
+       if (IS_PLAYER(player) && !IS_DEAD(player))
                ca_LastPlayerForTeam_Notify(player);
        if (player.killindicator_teamchange == -2) // player wants to spectate
                player.caplayer = 0;
@@ -448,6 +448,8 @@ MUTATOR_HOOKFUNCTION(ca, SpectatePrev)
                                return MUT_SPECPREV_RETURN;
                }
        }
+       else
+               return MUT_SPECPREV_CONTINUE;
 
        M_ARGV(1, entity) = targ;