diff options
author | icculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2009-09-14 01:37:59 +0000 |
---|---|---|
committer | icculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2009-09-14 01:37:59 +0000 |
commit | 02fe9c726bf077a9cf709593ac497888c572b819 (patch) | |
tree | 9bd8db138ac0879a7d9cfcddd82bc2a029cf4d98 /code/client | |
parent | 4ec7087749b47094d79ae63016a646b9f280839a (diff) | |
download | ioquake3-aero-02fe9c726bf077a9cf709593ac497888c572b819.tar.gz ioquake3-aero-02fe9c726bf077a9cf709593ac497888c572b819.zip |
Better handling of "voip" console command.
Prints usage info and current gain values, and catches a case where we
report an error where no error exists.
Fixes Bugzilla #4018.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1585 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client')
-rw-r--r-- | code/client/cl_main.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/code/client/cl_main.c b/code/client/cl_main.c index e77761b..6856e73 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -192,8 +192,10 @@ void CL_UpdateVoipIgnore(const char *idstr, qboolean ignore) ignore ? "ignore" : "unignore", id)); Com_Printf("VoIP: %s ignoring player #%d\n", ignore ? "Now" : "No longer", id); + return; } } + Com_Printf("VoIP: invalid player ID#\n"); } static @@ -234,7 +236,19 @@ void CL_Voip_f( void ) } else if (strcmp(cmd, "unignore") == 0) { CL_UpdateVoipIgnore(Cmd_Argv(2), qfalse); } else if (strcmp(cmd, "gain") == 0) { - CL_UpdateVoipGain(Cmd_Argv(2), atof(Cmd_Argv(3))); + if (Cmd_Argc() > 3) { + CL_UpdateVoipGain(Cmd_Argv(2), atof(Cmd_Argv(3))); + } else if (Q_isanumber(Cmd_Argv(2))) { + int id = atoi(Cmd_Argv(2)); + if (id >= 0 && id < MAX_CLIENTS) { + Com_Printf("VoIP: current gain for player #%d " + "is %f\n", id, clc.voipGain[id]); + } else { + Com_Printf("VoIP: invalid player ID#\n"); + } + } else { + Com_Printf("usage: voip gain <playerID#> [value]\n"); + } } else if (strcmp(cmd, "muteall") == 0) { Com_Printf("VoIP: muting incoming voice\n"); CL_AddReliableCommand("voip muteall"); @@ -243,6 +257,10 @@ void CL_Voip_f( void ) Com_Printf("VoIP: unmuting incoming voice\n"); CL_AddReliableCommand("voip unmuteall"); clc.voipMuteAll = qfalse; + } else { + Com_Printf("usage: voip [un]ignore <playerID#>\n" + " voip [un]muteall\n" + " voip gain <playerID#> [value]\n"); } } |