diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_cmds.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index deb92e1a..eb001457 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1094,6 +1094,8 @@ void Cmd_CallVote_f( gentity_t *ent ) !Q_stricmp( arg1, "unmute" ) ) { int clientNums[ MAX_CLIENTS ]; + int matches = 0; + char err[ MAX_STRING_CHARS ] = ""; if( !arg2[ 0 ] ) { @@ -1102,7 +1104,8 @@ void Cmd_CallVote_f( gentity_t *ent ) return; } - if( G_ClientNumbersFromString( arg2, clientNums, MAX_CLIENTS ) == 1 ) + matches = G_ClientNumbersFromString( arg2, clientNums, MAX_CLIENTS ); + if( matches == 1 ) { // there was only one partial name match clientNum = clientNums[ 0 ]; @@ -1119,6 +1122,12 @@ void Cmd_CallVote_f( gentity_t *ent ) sizeof( name ) ); Q_CleanStr( name ); } + else if( matches > 1 ) + { + G_MatchOnePlayer( clientNums, matches, err, sizeof( err ) ); + ADMP( va( "^3callvote: ^7%s\n", err ) ); + return; + } else { trap_SendServerCommand( ent-g_entities, @@ -1368,6 +1377,8 @@ void Cmd_CallTeamVote_f( gentity_t *ent ) !Q_stricmp( arg1, "allowbuild" ) ) { int clientNums[ MAX_CLIENTS ]; + int matches = 0; + char err[ MAX_STRING_CHARS ] = ""; if( !arg2[ 0 ] ) { @@ -1376,7 +1387,8 @@ void Cmd_CallTeamVote_f( gentity_t *ent ) return; } - if( G_ClientNumbersFromString( arg2, clientNums, MAX_CLIENTS ) == 1 ) + matches = G_ClientNumbersFromString( arg2, clientNums, MAX_CLIENTS ) ; + if( matches == 1 ) { // there was only one partial name match clientNum = clientNums[ 0 ]; @@ -1400,6 +1412,12 @@ void Cmd_CallTeamVote_f( gentity_t *ent ) sizeof( name ) ); Q_CleanStr( name ); } + else if( matches > 1 ) + { + G_MatchOnePlayer( clientNums, matches, err, sizeof( err ) ); + ADMP( va( "^3callteamvote: ^7%s\n", err ) ); + return; + } else { trap_SendServerCommand( ent-g_entities, |