diff options
author | icculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-06-07 14:40:30 +0000 |
---|---|---|
committer | icculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-06-07 14:40:30 +0000 |
commit | 232f3ce4ca468acc372edae4115defdbd62cd058 (patch) | |
tree | 5f44a9f97812ff6f93d785707b523658ade17dcd | |
parent | 3140bde1ea10558f821c22baaa646a4f92b195af (diff) | |
download | ioquake3-aero-232f3ce4ca468acc372edae4115defdbd62cd058.tar.gz ioquake3-aero-232f3ce4ca468acc372edae4115defdbd62cd058.zip |
VoIP: Only update from cl_voipSendTarget if sending data.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1374 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r-- | code/client/cl_input.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/code/client/cl_input.c b/code/client/cl_input.c index 46ede87..e2ee6f6 100644 --- a/code/client/cl_input.c +++ b/code/client/cl_input.c @@ -759,34 +759,35 @@ void CL_WritePacket( void ) { } #if USE_VOIP - // Move cl_voipSendTarget from a string to a - if (cl_voipSendTarget->modified) { - const char *target = cl_voipSendTarget->string; - if ((*target == '\0') || (Q_stricmp(target, "all") == 0)) { - clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0x7FFFFFFF; - } else if (Q_stricmp(target, "none") == 0) { - clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0; - } else { - clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0; - const char *ptr = target; - do { - if ((*ptr == ',') || (*ptr == '\0')) { - const int val = atoi(target); - target = ptr + 1; - if ((val >= 0) && (val < 31)) { - clc.voipTarget1 |= (1 << (val-0)); - } else if ((val >= 31) && (val < 62)) { - clc.voipTarget2 |= (1 << (val-31)); - } else if ((val >= 62) && (val < 93)) { - clc.voipTarget3 |= (1 << (val-62)); + if (clc.voipOutgoingDataSize > 0) { // only send if data. + // Move cl_voipSendTarget from a string to the bitmasks if needed. + if (cl_voipSendTarget->modified) { + const char *target = cl_voipSendTarget->string; + if ((*target == '\0') || (Q_stricmp(target, "all") == 0)) { + const int all = 0x7FFFFFFF; + clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = all; + } else if (Q_stricmp(target, "none") == 0) { + clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0; + } else { + clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0; + const char *ptr = target; + do { + if ((*ptr == ',') || (*ptr == '\0')) { + const int val = atoi(target); + target = ptr + 1; + if ((val >= 0) && (val < 31)) { + clc.voipTarget1 |= (1 << (val-0)); + } else if ((val >= 31) && (val < 62)) { + clc.voipTarget2 |= (1 << (val-31)); + } else if ((val >= 62) && (val < 93)) { + clc.voipTarget3 |= (1 << (val-62)); + } } - } - } while (*(ptr++)); + } while (*(ptr++)); + } + cl_voipSendTarget->modified = qfalse; } - cl_voipSendTarget->modified = qfalse; - } - if (clc.voipOutgoingDataSize > 0) { // only send if data. MSG_WriteByte (&buf, clc_EOF); // placate legacy servers. MSG_WriteByte (&buf, clc_extension); MSG_WriteByte (&buf, clc_voip); |