diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index 20e7b58..b323557 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -661,9 +661,17 @@ void Cmd_Team_f( gentity_t *ent ) { int oldTeam; char s[MAX_TOKEN_CHARS]; - // demo playback: spectators only + // demo playback: only allow "team spectator" (to exit follow mode) if ( trap_Cvar_VariableIntegerValue( "sv_demoplaying" ) ) { - trap_SendServerCommand( ent-g_entities, "print \"Team changes disabled during demo playback.\n\"" ); + char s2[MAX_TOKEN_CHARS]; + if ( trap_Argc() == 2 ) { + trap_Argv( 1, s2, sizeof(s2) ); + if ( !Q_stricmp( s2, "spectator" ) || !Q_stricmp( s2, "s" ) ) { + StopFollowing( ent ); + return; + } + } + trap_SendServerCommand( ent-g_entities, "print \"Only spectating allowed during demo playback.\n\"" ); return; }