From 251a486c25bc0c6c831fa0673de5fa6e98cb6915 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 22 Jan 2019 14:55:37 +0100 Subject: [PATCH] CA: fix 'spectate previous player' action not working when all members of your team are dead in games with 3 or more teams (and 'spectate next player' action not cycling through the players); it fixes #2062 (together with the previous commit) --- qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index 686b0cbae..cdcb0d0d0 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@ -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)); -- 2.39.2