summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-03 12:51:07 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:17 +0000
commitb968783fd19938474c1b4867ff37dd5e36af06b0 (patch)
treeda2256dbd5558392446cb595db2cbc121ec441bb /src/game/g_cmds.c
parentb070d7b7a239aa7a8bb26d917bf2b57093a0159f (diff)
* Prevent spectating a player while alive (thanks Byron Johnson)
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 812f5a83..f3f793b2 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -2798,6 +2798,10 @@ void Cmd_Follow_f( gentity_t *ent )
int pids[ MAX_CLIENTS ];
char arg[ MAX_NAME_LENGTH ];
+ // won't work unless spectating
+ if( ent->client->sess.spectatorState == SPECTATOR_NOT )
+ return;
+
if( trap_Argc( ) != 2 )
{
G_ToggleFollow( ent );
@@ -2830,7 +2834,7 @@ void Cmd_Follow_f( gentity_t *ent )
level.clients[ i ].sess.spectatorState != SPECTATOR_NOT )
return;
- // can only follow teammates when dead and on a team
+ // if not on team spectator, you can only follow teammates
if( ent->client->pers.teamSelection != TEAM_NONE &&
( level.clients[ i ].pers.teamSelection !=
ent->client->pers.teamSelection ) )