[ioquake3] 04/50: Make cg_teamChatsOnly only affect team gametypes
Simon McVittie
smcv at debian.org
Sun Jul 23 21:55:22 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository ioquake3.
commit 520b10044924b6e687d857827801752a1c5be523
Author: Zack Middleton <zack at cloemail.com>
Date: Sat Jun 24 19:47:35 2017 -0500
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.
---
code/cgame/cg_servercmds.c | 45 ++++++++++++++++++++++++---------------------
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c
index d1c8b28..57ca19b 100644
--- a/code/cgame/cg_servercmds.c
+++ b/code/cgame/cg_servercmds.c
@@ -899,6 +899,10 @@ void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color,
return;
}
+ if ( mode == SAY_ALL && cgs.gametype >= GT_TEAM && cg_teamChatsOnly.integer ) {
+ return;
+ }
+
if ( clientNum < 0 || clientNum >= MAX_CLIENTS ) {
clientNum = 0;
}
@@ -909,23 +913,20 @@ void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color,
voiceChatList = CG_VoiceChatListForClient( clientNum );
if ( CG_GetVoiceChat( voiceChatList, cmd, &snd, &chat ) ) {
- //
- if ( mode == SAY_TEAM || !cg_teamChatsOnly.integer ) {
- vchat.clientNum = clientNum;
- vchat.snd = snd;
- vchat.voiceOnly = voiceOnly;
- Q_strncpyz(vchat.cmd, cmd, sizeof(vchat.cmd));
- 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);
+ vchat.clientNum = clientNum;
+ vchat.snd = snd;
+ vchat.voiceOnly = voiceOnly;
+ Q_strncpyz(vchat.cmd, cmd, sizeof(vchat.cmd));
+ 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);
}
}
@@ -1017,12 +1018,14 @@ static void CG_ServerCommand( void ) {
}
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 );
+ if ( cgs.gametype >= GT_TEAM && cg_teamChatsOnly.integer ) {
+ return;
}
+
+ 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;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git
More information about the Pkg-games-commits
mailing list