CA: fix 'spectate previous player' action not working when all members of your team...
authorterencehill <piuntn@gmail.com>
Tue, 22 Jan 2019 13:55:37 +0000 (14:55 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 22 Jan 2019 13:55:37 +0000 (14:55 +0100)
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc

index 686b0cb..cdcb0d0 100644 (file)
@@ -421,7 +421,8 @@ MUTATOR_HOOKFUNCTION(ca, SpectateNext)
 {
        entity client = M_ARGV(0, entity);
 
-       if (!autocvar_g_ca_spectate_enemies && client.caplayer)
+       if (!autocvar_g_ca_spectate_enemies && client.caplayer
+               && Team_GetNumberOfAlivePlayers(Entity_GetTeam(client)))
        {
                entity targ = M_ARGV(1, entity);
                M_ARGV(1, entity) = CA_SpectateNext(client, targ);
@@ -435,7 +436,8 @@ MUTATOR_HOOKFUNCTION(ca, SpectatePrev)
        entity targ = M_ARGV(1, entity);
        entity first = M_ARGV(2, entity);
 
-       if (!autocvar_g_ca_spectate_enemies && client.caplayer)
+       if (!autocvar_g_ca_spectate_enemies && client.caplayer
+               && Team_GetNumberOfAlivePlayers(Entity_GetTeam(client)))
        {
                do { targ = targ.chain; }
                while(targ && DIFF_TEAM(targ, client));