diff options
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 51f5ea65..68a251b9 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -90,11 +90,25 @@ int G_ClientNumberFromString( char *s, char *err, int len ) cl = &level.clients[ i ]; if( cl->pers.connected == CON_DISCONNECTED ) + { + if( p ) + Q_strncpyz( p, "no player connected in that slot #\n", len ); + return -1; + } return i; } + G_SanitiseString( s, s2, sizeof( s2 ) ); + if( !s2[ 0 ] ) + { + if( p ) + Q_strncpyz( p, "no player name provided\n", len ); + + return -1; + } + if( p ) { Q_strncpyz( p, "more than one player name matches. " @@ -105,9 +119,6 @@ int G_ClientNumberFromString( char *s, char *err, int len ) } // check for a name match - G_SanitiseString( s, s2, sizeof( s2 ) ); - if( !s2[ 0 ] ) - return -1; for( i = 0, cl = level.clients; i < level.maxclients; i++, cl++ ) { if( cl->pers.connected == CON_DISCONNECTED ) |