mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-13 00:24:10 +00:00
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:
parent
f19efb77c8
commit
520b100449
1 changed files with 24 additions and 21 deletions
|
@ -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,23 +913,20 @@ 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 ) ) {
|
||||||
//
|
vchat.clientNum = clientNum;
|
||||||
if ( mode == SAY_TEAM || !cg_teamChatsOnly.integer ) {
|
vchat.snd = snd;
|
||||||
vchat.clientNum = clientNum;
|
vchat.voiceOnly = voiceOnly;
|
||||||
vchat.snd = snd;
|
Q_strncpyz(vchat.cmd, cmd, sizeof(vchat.cmd));
|
||||||
vchat.voiceOnly = voiceOnly;
|
if ( mode == SAY_TELL ) {
|
||||||
Q_strncpyz(vchat.cmd, cmd, sizeof(vchat.cmd));
|
Com_sprintf(vchat.message, sizeof(vchat.message), "[%s]: %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
|
||||||
if ( mode == SAY_TELL ) {
|
|
||||||
Com_sprintf(vchat.message, sizeof(vchat.message), "[%s]: %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
|
|
||||||
}
|
|
||||||
else if ( mode == SAY_TEAM ) {
|
|
||||||
Com_sprintf(vchat.message, sizeof(vchat.message), "(%s): %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Com_sprintf(vchat.message, sizeof(vchat.message), "%s: %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
|
|
||||||
}
|
|
||||||
CG_AddBufferedVoiceChat(&vchat);
|
|
||||||
}
|
}
|
||||||
|
else if ( mode == SAY_TEAM ) {
|
||||||
|
Com_sprintf(vchat.message, sizeof(vchat.message), "(%s): %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Com_sprintf(vchat.message, sizeof(vchat.message), "%s: %c%c%s", ci->name, Q_COLOR_ESCAPE, color, chat);
|
||||||
|
}
|
||||||
|
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 ) {
|
||||||
trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND );
|
return;
|
||||||
Q_strncpyz( text, CG_Argv(1), MAX_SAY_TEXT );
|
|
||||||
CG_RemoveChatEscapeChar( text );
|
|
||||||
CG_Printf( "%s\n", text );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue