From: terencehill Date: Sat, 15 Jun 2013 17:00:24 +0000 (+0200) Subject: Make cmd followfc change to the other fc if we are already spectating a fc X-Git-Tag: xonotic-v0.8.0~355^2~2^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4d42bd03a1c0c82d64619668a447a0009f9713c7;p=xonotic%2Fxonotic-data.pk3dir.git Make cmd followfc change to the other fc if we are already spectating a fc --- 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; }