Make cg_teamChatsOnly only affect team gametypes

Also made it so that 'tell voice chats' are always allowed for
consistancy with 'tell chat'.

Reported by Tobias Kuehnhammer.
This commit is contained in:
Zack Middleton 2017-06-24 19:47:35 -05:00
parent f19efb77c8
commit 520b100449

View file

@ -899,6 +899,10 @@ void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color,
return; return;
} }
if ( mode == SAY_ALL && cgs.gametype >= GT_TEAM && cg_teamChatsOnly.integer ) {
return;
}
if ( clientNum < 0 || clientNum >= MAX_CLIENTS ) { if ( clientNum < 0 || clientNum >= MAX_CLIENTS ) {
clientNum = 0; clientNum = 0;
} }
@ -909,8 +913,6 @@ void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color,
voiceChatList = CG_VoiceChatListForClient( clientNum ); voiceChatList = CG_VoiceChatListForClient( clientNum );
if ( CG_GetVoiceChat( voiceChatList, cmd, &snd, &chat ) ) { if ( CG_GetVoiceChat( voiceChatList, cmd, &snd, &chat ) ) {
//
if ( mode == SAY_TEAM || !cg_teamChatsOnly.integer ) {
vchat.clientNum = clientNum; vchat.clientNum = clientNum;
vchat.snd = snd; vchat.snd = snd;
vchat.voiceOnly = voiceOnly; vchat.voiceOnly = voiceOnly;
@ -927,7 +929,6 @@ void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color,
CG_AddBufferedVoiceChat(&vchat); CG_AddBufferedVoiceChat(&vchat);
} }
} }
}
/* /*
================= =================
@ -1017,12 +1018,14 @@ static void CG_ServerCommand( void ) {
} }
if ( !strcmp( cmd, "chat" ) ) { if ( !strcmp( cmd, "chat" ) ) {
if ( !cg_teamChatsOnly.integer ) { if ( cgs.gametype >= GT_TEAM && cg_teamChatsOnly.integer ) {
return;
}
trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND ); trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND );
Q_strncpyz( text, CG_Argv(1), MAX_SAY_TEXT ); Q_strncpyz( text, CG_Argv(1), MAX_SAY_TEXT );
CG_RemoveChatEscapeChar( text ); CG_RemoveChatEscapeChar( text );
CG_Printf( "%s\n", text ); CG_Printf( "%s\n", text );
}
return; return;
} }