summaryrefslogtreecommitdiff
path: root/src/game/g_svcmds.c
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2011-01-11 04:21:15 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:50 +0000
commit4da76278ada8d004598e84753e4833fce79019ef (patch)
tree906d3f2a83ccc27103f30edcd289d86cce1c4ab8 /src/game/g_svcmds.c
parentbb4db330cb3f223ee786a57cfd2b603c1bfa053e (diff)
* Refactor code handling player name matching
Diffstat (limited to 'src/game/g_svcmds.c')
-rw-r--r--src/game/g_svcmds.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/game/g_svcmds.c b/src/game/g_svcmds.c
index ff9b0895..9338766f 100644
--- a/src/game/g_svcmds.c
+++ b/src/game/g_svcmds.c
@@ -117,23 +117,15 @@ void Svcmd_EntityList_f( void )
static gclient_t *ClientForString( char *s )
{
- int idnum, count;
- int pids[ MAX_CLIENTS ];
+ int idnum;
+ char err[ MAX_STRING_CHARS ];
- if( ( count = G_ClientNumbersFromString( s, pids, MAX_CLIENTS ) ) != 1 )
+ idnum = G_ClientNumberFromString( s, err, sizeof( err ) );
+ if( idnum == -1 )
{
- idnum = G_ClientNumberFromString( s );
-
- if( idnum == -1 )
- {
- char err[ MAX_STRING_CHARS ];
- G_MatchOnePlayer( pids, count, err, sizeof( err ) );
- G_Printf( "%s\n", err );
- return NULL;
- }
+ G_Printf( "%s", err );
+ return NULL;
}
- else
- idnum = pids[ 0 ];
return &level.clients[ idnum ];
}