]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 686b0cbae06cddbf42a460a1ecae11a61f38b2fa..cdcb0d0d0fbedd16efa54e6a36f4d224f3a011a2 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));