diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_local.h | 4 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 3 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 517 |
3 files changed, 285 insertions, 239 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 855bb39e..06fbc132 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1007,6 +1007,10 @@ typedef struct { sfxHandle_t countFightSound; sfxHandle_t countPrepareSound; + //TA: + sfxHandle_t alienStageTransition; + sfxHandle_t humanStageTransition; + qhandle_t cursor; qhandle_t selectCursor; qhandle_t sizeCursor; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 1372c9b3..9b874dcb 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -513,6 +513,9 @@ static void CG_RegisterSounds( void ) { cgs.media.count1Sound = trap_S_RegisterSound( "sound/feedback/one.wav", qtrue ); cgs.media.countFightSound = trap_S_RegisterSound( "sound/feedback/fight.wav", qtrue ); cgs.media.countPrepareSound = trap_S_RegisterSound( "sound/feedback/prepare.wav", qtrue ); + + cgs.media.alienStageTransition = trap_S_RegisterSound( "sound/announcements/overmindevolved.wav", qtrue ); + cgs.media.humanStageTransition = trap_S_RegisterSound( "sound/announcements/reinforcement.wav", qtrue ); if ( cgs.gametype >= GT_TEAM || cg_buildScript.integer ) { cgs.media.captureAwardSound = trap_S_RegisterSound( "sound/teamplay/flagcapture_yourteam.wav", qtrue ); diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index 09b7704e..2ee0c2e5 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -48,18 +48,18 @@ CG_ParseScores ================= */ static void CG_ParseScores( void ) { - int i, powerups; + int i, powerups; - cg.numScores = atoi( CG_Argv( 1 ) ); - if ( cg.numScores > MAX_CLIENTS ) { - cg.numScores = MAX_CLIENTS; - } + cg.numScores = atoi( CG_Argv( 1 ) ); + if ( cg.numScores > MAX_CLIENTS ) { + cg.numScores = MAX_CLIENTS; + } - cg.teamScores[0] = atoi( CG_Argv( 2 ) ); - cg.teamScores[1] = atoi( CG_Argv( 3 ) ); + cg.teamScores[0] = atoi( CG_Argv( 2 ) ); + cg.teamScores[1] = atoi( CG_Argv( 3 ) ); - memset( cg.scores, 0, sizeof( cg.scores ) ); - for ( i = 0 ; i < cg.numScores ; i++ ) { + memset( cg.scores, 0, sizeof( cg.scores ) ); + for ( i = 0 ; i < cg.numScores ; i++ ) { // cg.scores[i].client = atoi( CG_Argv( i * 14 + 4 ) ); cg.scores[i].score = atoi( CG_Argv( i * 14 + 5 ) ); @@ -76,14 +76,14 @@ static void CG_ParseScores( void ) { cg.scores[i].perfect = atoi(CG_Argv(i * 14 + 16)); cg.scores[i].captures = atoi(CG_Argv(i * 14 + 17)); - if ( cg.scores[i].client < 0 || cg.scores[i].client >= MAX_CLIENTS ) { - cg.scores[i].client = 0; - } - cgs.clientinfo[ cg.scores[i].client ].score = cg.scores[i].score; - cgs.clientinfo[ cg.scores[i].client ].powerups = powerups; + if ( cg.scores[i].client < 0 || cg.scores[i].client >= MAX_CLIENTS ) { + cg.scores[i].client = 0; + } + cgs.clientinfo[ cg.scores[i].client ].score = cg.scores[i].score; + cgs.clientinfo[ cg.scores[i].client ].powerups = powerups; cg.scores[i].team = cgs.clientinfo[cg.scores[i].client].team; - } + } } @@ -94,22 +94,22 @@ CG_ParseTeamInfo ================= */ static void CG_ParseTeamInfo( void ) { - int i; - int client; + int i; + int client; - numSortedTeamPlayers = atoi( CG_Argv( 1 ) ); + numSortedTeamPlayers = atoi( CG_Argv( 1 ) ); - for ( i = 0 ; i < numSortedTeamPlayers ; i++ ) { - client = atoi( CG_Argv( i * 6 + 2 ) ); + for ( i = 0 ; i < numSortedTeamPlayers ; i++ ) { + client = atoi( CG_Argv( i * 6 + 2 ) ); - sortedTeamPlayers[i] = client; + sortedTeamPlayers[i] = client; - cgs.clientinfo[ client ].location = atoi( CG_Argv( i * 6 + 3 ) ); - cgs.clientinfo[ client ].health = atoi( CG_Argv( i * 6 + 4 ) ); - cgs.clientinfo[ client ].armor = atoi( CG_Argv( i * 6 + 5 ) ); - cgs.clientinfo[ client ].curWeapon = atoi( CG_Argv( i * 6 + 6 ) ); - cgs.clientinfo[ client ].powerups = atoi( CG_Argv( i * 6 + 7 ) ); - } + cgs.clientinfo[ client ].location = atoi( CG_Argv( i * 6 + 3 ) ); + cgs.clientinfo[ client ].health = atoi( CG_Argv( i * 6 + 4 ) ); + cgs.clientinfo[ client ].armor = atoi( CG_Argv( i * 6 + 5 ) ); + cgs.clientinfo[ client ].curWeapon = atoi( CG_Argv( i * 6 + 6 ) ); + cgs.clientinfo[ client ].powerups = atoi( CG_Argv( i * 6 + 7 ) ); + } } @@ -122,20 +122,20 @@ and whenever the server updates any serverinfo flagged cvars ================ */ void CG_ParseServerinfo( void ) { - const char *info; - char *mapname; + const char *info; + char *mapname; - info = CG_ConfigString( CS_SERVERINFO ); - cgs.gametype = atoi( Info_ValueForKey( info, "g_gametype" ) ); + info = CG_ConfigString( CS_SERVERINFO ); + cgs.gametype = atoi( Info_ValueForKey( info, "g_gametype" ) ); trap_Cvar_Set("g_gametype", va("%i", cgs.gametype)); - cgs.dmflags = atoi( Info_ValueForKey( info, "dmflags" ) ); - cgs.teamflags = atoi( Info_ValueForKey( info, "teamflags" ) ); - cgs.fraglimit = atoi( Info_ValueForKey( info, "fraglimit" ) ); - cgs.capturelimit = atoi( Info_ValueForKey( info, "capturelimit" ) ); - cgs.timelimit = atoi( Info_ValueForKey( info, "timelimit" ) ); - cgs.maxclients = atoi( Info_ValueForKey( info, "sv_maxclients" ) ); - mapname = Info_ValueForKey( info, "mapname" ); - Com_sprintf( cgs.mapname, sizeof( cgs.mapname ), "maps/%s.bsp", mapname ); + cgs.dmflags = atoi( Info_ValueForKey( info, "dmflags" ) ); + cgs.teamflags = atoi( Info_ValueForKey( info, "teamflags" ) ); + cgs.fraglimit = atoi( Info_ValueForKey( info, "fraglimit" ) ); + cgs.capturelimit = atoi( Info_ValueForKey( info, "capturelimit" ) ); + cgs.timelimit = atoi( Info_ValueForKey( info, "timelimit" ) ); + cgs.maxclients = atoi( Info_ValueForKey( info, "sv_maxclients" ) ); + mapname = Info_ValueForKey( info, "mapname" ); + Com_sprintf( cgs.mapname, sizeof( cgs.mapname ), "maps/%s.bsp", mapname ); Q_strncpyz( cgs.redTeam, Info_ValueForKey( info, "g_redTeam" ), sizeof(cgs.redTeam) ); trap_Cvar_Set("g_redTeam", cgs.redTeam); Q_strncpyz( cgs.blueTeam, Info_ValueForKey( info, "g_blueTeam" ), sizeof(cgs.blueTeam) ); @@ -148,21 +148,21 @@ CG_ParseWarmup ================== */ static void CG_ParseWarmup( void ) { - const char *info; - int warmup; + const char *info; + int warmup; - info = CG_ConfigString( CS_WARMUP ); + info = CG_ConfigString( CS_WARMUP ); - warmup = atoi( info ); - cg.warmupCount = -1; + warmup = atoi( info ); + cg.warmupCount = -1; - if ( warmup == 0 && cg.warmup ) { + if ( warmup == 0 && cg.warmup ) { - } else if ( warmup > 0 && cg.warmup <= 0 ) { - trap_S_StartLocalSound( cgs.media.countPrepareSound, CHAN_ANNOUNCER ); - } + } else if ( warmup > 0 && cg.warmup <= 0 ) { + trap_S_StartLocalSound( cgs.media.countPrepareSound, CHAN_ANNOUNCER ); + } - cg.warmup = warmup; + cg.warmup = warmup; } /* @@ -172,11 +172,12 @@ CG_SetConfigValues Called on load to set the initial values from configure strings ================ */ -void CG_SetConfigValues( void ) { - const char *s; +void CG_SetConfigValues( void ) +{ + const char *s; - cgs.scores1 = atoi( CG_ConfigString( CS_SCORES1 ) ); - cgs.scores2 = atoi( CG_ConfigString( CS_SCORES2 ) ); + cgs.scores1 = atoi( CG_ConfigString( CS_SCORES1 ) ); + cgs.scores2 = atoi( CG_ConfigString( CS_SCORES2 ) ); sscanf( CG_ConfigString( CS_BUILDPOINTS ), "%d %d %d %d %d", &cgs.alienBuildPoints, @@ -187,13 +188,13 @@ void CG_SetConfigValues( void ) { sscanf( CG_ConfigString( CS_STAGES ), "%d %d", &cgs.alienStage, &cgs.humanStage ); - cgs.levelStartTime = atoi( CG_ConfigString( CS_LEVEL_START_TIME ) ); + cgs.levelStartTime = atoi( CG_ConfigString( CS_LEVEL_START_TIME ) ); if( cgs.gametype == GT_CTF ) { s = CG_ConfigString( CS_FLAGSTATUS ); cgs.redflag = s[0] - '0'; cgs.blueflag = s[1] - '0'; } - cg.warmup = atoi( CG_ConfigString( CS_WARMUP ) ); + cg.warmup = atoi( CG_ConfigString( CS_WARMUP ) ); } @@ -237,6 +238,33 @@ void CG_ShaderStateChanged(void) { } } +/* +================ +CG_AnnounceAlienStageTransistion +================ +*/ +static void CG_AnnounceAlienStageTransistion( stage_t from, stage_t to ) +{ + if( cg.predictedPlayerState.stats[ STAT_PTEAM ] != PTE_ALIENS ) + return; + + trap_S_StartLocalSound( cgs.media.alienStageTransition, CHAN_ANNOUNCER ); + CG_CenterPrint( "We have evolved!", 200, GIANTCHAR_WIDTH * 4 ); +} + +/* +================ +CG_AnnounceHumanStageTransistion +================ +*/ +static void CG_AnnounceHumanStageTransistion( stage_t from, stage_t to ) +{ + if( cg.predictedPlayerState.stats[ STAT_PTEAM ] != PTE_HUMANS ) + return; + + trap_S_StartLocalSound( cgs.media.humanStageTransition, CHAN_ANNOUNCER ); + CG_CenterPrint( "Reinforcements have arrived!", 200, GIANTCHAR_WIDTH * 4 ); +} /* ================ @@ -245,50 +273,61 @@ CG_ConfigStringModified ================ */ static void CG_ConfigStringModified( void ) { - const char *str; - int num; - - num = atoi( CG_Argv( 1 ) ); - - // get the gamestate from the client system, which will have the - // new configstring already integrated - trap_GetGameState( &cgs.gameState ); - - // look up the individual string that was modified - str = CG_ConfigString( num ); - - // do something with it if necessary - if ( num == CS_MUSIC ) { - CG_StartMusic(); - } else if ( num == CS_SERVERINFO ) { - CG_ParseServerinfo(); - } else if ( num == CS_WARMUP ) { - CG_ParseWarmup(); - } else if ( num == CS_SCORES1 ) { - cgs.scores1 = atoi( str ); - } else if ( num == CS_SCORES2 ) { - cgs.scores2 = atoi( str ); + const char *str; + int num; + + num = atoi( CG_Argv( 1 ) ); + + // get the gamestate from the client system, which will have the + // new configstring already integrated + trap_GetGameState( &cgs.gameState ); + + // look up the individual string that was modified + str = CG_ConfigString( num ); + + // do something with it if necessary + if ( num == CS_MUSIC ) { + CG_StartMusic(); + } else if ( num == CS_SERVERINFO ) { + CG_ParseServerinfo(); + } else if ( num == CS_WARMUP ) { + CG_ParseWarmup(); + } else if ( num == CS_SCORES1 ) { + cgs.scores1 = atoi( str ); + } else if ( num == CS_SCORES2 ) { + cgs.scores2 = atoi( str ); } else if( num == CS_BUILDPOINTS ) { sscanf( str, "%d %d %d %d %d", &cgs.alienBuildPoints, &cgs.alienBuildPointsTotal, &cgs.humanBuildPoints, &cgs.humanBuildPointsTotal, &cgs.humanBuildPointsPowered ); - } else if( num == CS_STAGES ) { + } else if( num == CS_STAGES ) + { + stage_t oldAlienStage = cgs.alienStage; + stage_t oldHumanStage = cgs.humanStage; + sscanf( str, "%d %d", &cgs.alienStage, &cgs.humanStage ); - } else if ( num == CS_LEVEL_START_TIME ) { - cgs.levelStartTime = atoi( str ); - } else if ( num == CS_VOTE_TIME ) { - cgs.voteTime = atoi( str ); - cgs.voteModified = qtrue; - } else if ( num == CS_VOTE_YES ) { - cgs.voteYes = atoi( str ); - cgs.voteModified = qtrue; - } else if ( num == CS_VOTE_NO ) { - cgs.voteNo = atoi( str ); - cgs.voteModified = qtrue; - } else if ( num == CS_VOTE_STRING ) { - Q_strncpyz( cgs.voteString, str, sizeof( cgs.voteString ) ); + + if( cgs.alienStage != oldAlienStage ) + CG_AnnounceAlienStageTransistion( oldAlienStage, cgs.alienStage ); + + if( cgs.humanStage != oldHumanStage ) + CG_AnnounceHumanStageTransistion( oldHumanStage, cgs.humanStage ); + } + else if ( num == CS_LEVEL_START_TIME ) { + cgs.levelStartTime = atoi( str ); + } else if ( num == CS_VOTE_TIME ) { + cgs.voteTime = atoi( str ); + cgs.voteModified = qtrue; + } else if ( num == CS_VOTE_YES ) { + cgs.voteYes = atoi( str ); + cgs.voteModified = qtrue; + } else if ( num == CS_VOTE_NO ) { + cgs.voteNo = atoi( str ); + cgs.voteModified = qtrue; + } else if ( num == CS_VOTE_STRING ) { + Q_strncpyz( cgs.voteString, str, sizeof( cgs.voteString ) ); } else if ( num >= CS_TEAMVOTE_TIME && num <= CS_TEAMVOTE_TIME + 1) { cgs.teamVoteTime[num-CS_TEAMVOTE_TIME] = atoi( str ); cgs.teamVoteModified[num-CS_TEAMVOTE_TIME] = qtrue; @@ -300,20 +339,20 @@ static void CG_ConfigStringModified( void ) { cgs.teamVoteModified[num-CS_TEAMVOTE_NO] = qtrue; } else if ( num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1) { Q_strncpyz( cgs.teamVoteString[num-CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString ) ); - } else if ( num == CS_INTERMISSION ) { - cg.intermissionStarted = atoi( str ); - } else if ( num >= CS_MODELS && num < CS_MODELS+MAX_MODELS ) { - cgs.gameModels[ num-CS_MODELS ] = trap_R_RegisterModel( str ); - } else if ( num >= CS_SHADERS && num < CS_SHADERS+MAX_SHADERS ) { - cgs.gameShaders[ num-CS_SHADERS ] = trap_R_RegisterShader( str ); - } else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_SOUNDS ) { - if ( str[0] != '*' ) { // player specific sounds don't register here + } else if ( num == CS_INTERMISSION ) { + cg.intermissionStarted = atoi( str ); + } else if ( num >= CS_MODELS && num < CS_MODELS+MAX_MODELS ) { + cgs.gameModels[ num-CS_MODELS ] = trap_R_RegisterModel( str ); + } else if ( num >= CS_SHADERS && num < CS_SHADERS+MAX_SHADERS ) { + cgs.gameShaders[ num-CS_SHADERS ] = trap_R_RegisterShader( str ); + } else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_SOUNDS ) { + if ( str[0] != '*' ) { // player specific sounds don't register here cgs.gameSounds[ num-CS_SOUNDS] = trap_S_RegisterSound( str, qfalse ); - } - } else if ( num >= CS_PLAYERS && num < CS_PLAYERS+MAX_CLIENTS ) { - CG_NewClientInfo( num - CS_PLAYERS ); + } + } else if ( num >= CS_PLAYERS && num < CS_PLAYERS+MAX_CLIENTS ) { + CG_NewClientInfo( num - CS_PLAYERS ); CG_BuildSpectatorString(); - } else if ( num == CS_FLAGSTATUS ) { + } else if ( num == CS_FLAGSTATUS ) { if( cgs.gametype == GT_CTF ) { // format is rb where its red/blue, 0 is at base, 1 is taken, 2 is dropped cgs.redflag = str[0] - '0'; @@ -323,7 +362,7 @@ static void CG_ConfigStringModified( void ) { else if ( num == CS_SHADERSTATE ) { CG_ShaderStateChanged(); } - + } @@ -334,70 +373,70 @@ CG_AddToTeamChat ======================= */ static void CG_AddToTeamChat( const char *str ) { - int len; - char *p, *ls; - int lastcolor; - int chatHeight; - - if (cg_teamChatHeight.integer < TEAMCHAT_HEIGHT) { - chatHeight = cg_teamChatHeight.integer; - } else { - chatHeight = TEAMCHAT_HEIGHT; - } - - if (chatHeight <= 0 || cg_teamChatTime.integer <= 0) { - // team chat disabled, dump into normal chat - cgs.teamChatPos = cgs.teamLastChatPos = 0; - return; - } - - len = 0; - - p = cgs.teamChatMsgs[cgs.teamChatPos % chatHeight]; - *p = 0; - - lastcolor = '7'; - - ls = NULL; - while (*str) { - if (len > TEAMCHAT_WIDTH - 1) { - if (ls) { - str -= (p - ls); - str++; - p -= (p - ls); - } - *p = 0; - - cgs.teamChatMsgTimes[cgs.teamChatPos % chatHeight] = cg.time; - - cgs.teamChatPos++; - p = cgs.teamChatMsgs[cgs.teamChatPos % chatHeight]; - *p = 0; - *p++ = Q_COLOR_ESCAPE; - *p++ = lastcolor; - len = 0; - ls = NULL; - } - - if ( Q_IsColorString( str ) ) { - *p++ = *str++; - lastcolor = *str; - *p++ = *str++; - continue; - } - if (*str == ' ') { - ls = p; - } - *p++ = *str++; - len++; - } - *p = 0; - - cgs.teamChatMsgTimes[cgs.teamChatPos % chatHeight] = cg.time; - cgs.teamChatPos++; - - if (cgs.teamChatPos - cgs.teamLastChatPos > chatHeight) - cgs.teamLastChatPos = cgs.teamChatPos - chatHeight; + int len; + char *p, *ls; + int lastcolor; + int chatHeight; + + if (cg_teamChatHeight.integer < TEAMCHAT_HEIGHT) { + chatHeight = cg_teamChatHeight.integer; + } else { + chatHeight = TEAMCHAT_HEIGHT; + } + + if (chatHeight <= 0 || cg_teamChatTime.integer <= 0) { + // team chat disabled, dump into normal chat + cgs.teamChatPos = cgs.teamLastChatPos = 0; + return; + } + + len = 0; + + p = cgs.teamChatMsgs[cgs.teamChatPos % chatHeight]; + *p = 0; + + lastcolor = '7'; + + ls = NULL; + while (*str) { + if (len > TEAMCHAT_WIDTH - 1) { + if (ls) { + str -= (p - ls); + str++; + p -= (p - ls); + } + *p = 0; + + cgs.teamChatMsgTimes[cgs.teamChatPos % chatHeight] = cg.time; + + cgs.teamChatPos++; + p = cgs.teamChatMsgs[cgs.teamChatPos % chatHeight]; + *p = 0; + *p++ = Q_COLOR_ESCAPE; + *p++ = lastcolor; + len = 0; + ls = NULL; + } + + if ( Q_IsColorString( str ) ) { + *p++ = *str++; + lastcolor = *str; + *p++ = *str++; + continue; + } + if (*str == ' ') { + ls = p; + } + *p++ = *str++; + len++; + } + *p = 0; + + cgs.teamChatMsgTimes[cgs.teamChatPos % chatHeight] = cg.time; + cgs.teamChatPos++; + + if (cgs.teamChatPos - cgs.teamLastChatPos > chatHeight) + cgs.teamLastChatPos = cgs.teamChatPos - chatHeight; } @@ -414,36 +453,36 @@ require a reload of all the media =============== */ static void CG_MapRestart( void ) { - if ( cg_showmiss.integer ) { - CG_Printf( "CG_MapRestart\n" ); - } + if ( cg_showmiss.integer ) { + CG_Printf( "CG_MapRestart\n" ); + } - CG_InitLocalEntities(); - CG_InitMarkPolys(); + CG_InitLocalEntities(); + CG_InitMarkPolys(); CG_ClearParticles (); - // make sure the "3 frags left" warnings play again - cg.fraglimitWarnings = 0; + // make sure the "3 frags left" warnings play again + cg.fraglimitWarnings = 0; - cg.timelimitWarnings = 0; + cg.timelimitWarnings = 0; - cg.intermissionStarted = qfalse; + cg.intermissionStarted = qfalse; - cgs.voteTime = 0; + cgs.voteTime = 0; cg.mapRestart = qtrue; - CG_StartMusic(); + CG_StartMusic(); trap_S_ClearLoopingSounds(qtrue); - // we really should clear more parts of cg here and stop sounds + // we really should clear more parts of cg here and stop sounds - // play the "fight" sound if this is a restart without warmup - if ( cg.warmup == 0 /* && cgs.gametype == GT_TOURNAMENT */) { - trap_S_StartLocalSound( cgs.media.countFightSound, CHAN_ANNOUNCER ); - CG_CenterPrint( "FIGHT!", 120, GIANTCHAR_WIDTH*2 ); - } + // play the "fight" sound if this is a restart without warmup + if ( cg.warmup == 0 /* && cgs.gametype == GT_TOURNAMENT */) { + trap_S_StartLocalSound( cgs.media.countFightSound, CHAN_ANNOUNCER ); + CG_CenterPrint( "FIGHT!", 120, GIANTCHAR_WIDTH*2 ); + } trap_Cvar_Set("cg_thirdPerson", "0"); } @@ -934,43 +973,43 @@ Cmd_Argc() / Cmd_Argv() ================= */ static void CG_ServerCommand( void ) { - const char *cmd; + const char *cmd; char text[MAX_SAY_TEXT]; - cmd = CG_Argv(0); + cmd = CG_Argv(0); - if ( !cmd[0] ) { - // server claimed the command - return; - } + if ( !cmd[0] ) { + // server claimed the command + return; + } - if ( !strcmp( cmd, "cp" ) ) { + if ( !strcmp( cmd, "cp" ) ) { CG_CenterPrint( CG_Argv(1), SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH ); - return; - } + return; + } - if ( !strcmp( cmd, "cs" ) ) { - CG_ConfigStringModified(); - return; - } + if ( !strcmp( cmd, "cs" ) ) { + CG_ConfigStringModified(); + return; + } - if ( !strcmp( cmd, "print" ) ) { - CG_Printf( "%s", CG_Argv(1) ); - return; - } + if ( !strcmp( cmd, "print" ) ) { + CG_Printf( "%s", CG_Argv(1) ); + return; + } - if ( !strcmp( cmd, "chat" ) ) { + if ( !strcmp( cmd, "chat" ) ) { if ( !cg_teamChatsOnly.integer ) { trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND ); Q_strncpyz( text, CG_Argv(1), MAX_SAY_TEXT ); CG_RemoveChatEscapeChar( text ); CG_Printf( "%s\n", text ); } - return; - } + return; + } - if ( !strcmp( cmd, "tchat" ) ) { - trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND ); + if ( !strcmp( cmd, "tchat" ) ) { + trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND ); Q_strncpyz( text, CG_Argv(1), MAX_SAY_TEXT ); CG_RemoveChatEscapeChar( text ); CG_AddToTeamChat( text ); @@ -989,23 +1028,23 @@ static void CG_ServerCommand( void ) { if ( !strcmp( cmd, "vtell" ) ) { CG_VoiceChat( SAY_TELL ); - return; - } + return; + } - if ( !strcmp( cmd, "scores" ) ) { - CG_ParseScores(); - return; - } + if ( !strcmp( cmd, "scores" ) ) { + CG_ParseScores(); + return; + } - if ( !strcmp( cmd, "tinfo" ) ) { - CG_ParseTeamInfo(); - return; - } + if ( !strcmp( cmd, "tinfo" ) ) { + CG_ParseTeamInfo(); + return; + } - if ( !strcmp( cmd, "map_restart" ) ) { - CG_MapRestart(); - return; - } + if ( !strcmp( cmd, "map_restart" ) ) { + CG_MapRestart(); + return; + } /* if ( Q_stricmp (cmd, "remapShader") == 0 ) { if (trap_Argc() == 4) { @@ -1013,20 +1052,20 @@ static void CG_ServerCommand( void ) { } }*/ - // loaddeferred can be both a servercmd and a consolecmd - if ( !strcmp( cmd, "loaddefered" ) ) { // FIXME: spelled wrong, but not changing for demo - CG_LoadDeferredPlayers(); - return; - } + // loaddeferred can be both a servercmd and a consolecmd + if ( !strcmp( cmd, "loaddefered" ) ) { // FIXME: spelled wrong, but not changing for demo + CG_LoadDeferredPlayers(); + return; + } - // clientLevelShot is sent before taking a special screenshot for - // the menu system during development - if ( !strcmp( cmd, "clientLevelShot" ) ) { - cg.levelShot = qtrue; - return; - } + // clientLevelShot is sent before taking a special screenshot for + // the menu system during development + if ( !strcmp( cmd, "clientLevelShot" ) ) { + cg.levelShot = qtrue; + return; + } - CG_Printf( "Unknown client game command: %s\n", cmd ); + CG_Printf( "Unknown client game command: %s\n", cmd ); } @@ -1039,9 +1078,9 @@ with this this snapshot. ==================== */ void CG_ExecuteNewServerCommands( int latestSequence ) { - while ( cgs.serverCommandSequence < latestSequence ) { - if ( trap_GetServerCommand( ++cgs.serverCommandSequence ) ) { - CG_ServerCommand(); - } - } + while ( cgs.serverCommandSequence < latestSequence ) { + if ( trap_GetServerCommand( ++cgs.serverCommandSequence ) ) { + CG_ServerCommand(); + } + } } |