summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_players.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index f3553035..c23d5697 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -762,19 +762,24 @@ void CG_NewClientInfo( int clientNum )
newInfo.team = atoi( v );
// if this is us, execute team-specific config files
- // unfortunately, these get re-executed after a vid_restart, because the
- // cgame can't tell the difference between that and joining a new server
- if( clientNum == cg.clientNum &&
- ( !ci->infoValid || ci->team != newInfo.team ) )
- {
- char config[ MAX_STRING_CHARS ];
+ // the spectator config is a little unreliable because it's easy to get on
+ // to the spectator team without joining it - e.g. when a new game starts.
+ // It's not a big deal because the spec config is the least important
+ // slash used anyway.
+ // I guess it's possible for someone to change teams during a restart and
+ // for that to then be missed here. But that's rare enough that people can
+ // just exec the configs manually, I think.
+ if( clientNum == cg.clientNum && ci->infoValid &&
+ ci->team != newInfo.team )
+ {
+ char config[ MAX_CVAR_VALUE_STRING ];
trap_Cvar_VariableStringBuffer(
va( "cg_%sConfig", BG_TeamName( newInfo.team ) ),
config, sizeof( config ) );
if( config[ 0 ] )
- trap_SendConsoleCommand( va( "exec %s\n", config ) );
+ trap_SendConsoleCommand( va( "exec \"%s\"\n", config ) );
}
// model