From 4d42bd03a1c0c82d64619668a447a0009f9713c7 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 15 Jun 2013 19:00:24 +0200 Subject: [PATCH] Make cmd followfc change to the other fc if we are already spectating a fc --- qcsrc/server/mutators/mutator_superspec.qc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/mutators/mutator_superspec.qc b/qcsrc/server/mutators/mutator_superspec.qc index e5d2e8348..96c9f2530 100644 --- a/qcsrc/server/mutators/mutator_superspec.qc +++ b/qcsrc/server/mutators/mutator_superspec.qc @@ -380,6 +380,7 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand) entity _player; float _team = 0; + float found = FALSE; if(cmd_argc == 2) { @@ -392,10 +393,16 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand) FOR_EACH_PLAYER(_player) { if(_player.flagcarried && (_player.team == _team || _team == 0)) + { + found = TRUE; + if(_team == 0 && IS_SPEC(self) && self.enemy == _player) + continue; // already spectating a fc, try to find the other fc return _spectate(_player); + } } - superspec_msg("", "", self, "No active flag carrier\n", 1); + if(!found) + superspec_msg("", "", self, "No active flag carrier\n", 1); return TRUE; } -- 2.39.2