From: terencehill Date: Tue, 22 Jan 2019 13:55:37 +0000 (+0100) Subject: CA: fix 'spectate previous player' action not working when all members of your team... X-Git-Tag: xonotic-v0.8.5~1648 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=251a486c25bc0c6c831fa0673de5fa6e98cb6915 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) --- diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index 686b0cbae0..cdcb0d0d0f 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));