From: terencehill Date: Fri, 24 Jan 2014 10:25:43 +0000 (+0100) Subject: CA: Fix spectate command (F3) not working well if used when the player is spectator... X-Git-Tag: xonotic-v0.8.0~126^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ea4ddf5ed1fea43789c321cf5d15f3ceadd7aa30;p=xonotic%2Fxonotic-data.pk3dir.git CA: Fix spectate command (F3) not working well if used when the player is spectator but still in game (listed as player in the scoreboard) (player is dead and presses SPACE (join command)); in this case F3 didn't make him a real spectator as it should. --- diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 9f636416a..e68cf8bfa 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -562,15 +562,11 @@ void ClientCommand_spectate(float request) } } - if(IS_PLAYER(self) && autocvar_sv_spectate == 1) - ClientKill_TeamChange(-2); // observe - - // in CA, allow a dead player to move to spectators (without that, caplayer!=0 will be moved back to the player list) - // note: if arena game mode is ever done properly, this needs to be removed. - if(self.caplayer && (IS_SPEC(self) || IS_OBSERVER(self))) + if((IS_PLAYER(self) || self.caplayer) && autocvar_sv_spectate == 1) { - sprint(self, "WARNING: you will spectate in the next round.\n"); - self.caplayer = 0; + if(self.caplayer && (IS_SPEC(self) || IS_OBSERVER(self))) + sprint(self, "WARNING: you will spectate in the next round.\n"); + ClientKill_TeamChange(-2); // observe } } return; // never fall through to usage