mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
engine: server: return NULL in SV_ClientBy{Id,Name} if client array isn't allocated
This commit is contained in:
parent
dec71850a1
commit
2c0d6e06be
@ -799,7 +799,7 @@ sv_client_t *SV_ClientById( int id )
|
||||
|
||||
ASSERT( id >= 0 );
|
||||
|
||||
for( i = 0, cl = svs.clients; i < svgame.globals->maxClients; i++, cl++ )
|
||||
for( i = 0, cl = svs.clients; cl && i < svgame.globals->maxClients; i++, cl++ )
|
||||
{
|
||||
if( !cl->state )
|
||||
continue;
|
||||
@ -819,7 +819,7 @@ sv_client_t *SV_ClientByName( const char *name )
|
||||
if( !COM_CheckString( name ))
|
||||
return NULL;
|
||||
|
||||
for( i = 0, cl = svs.clients; i < svgame.globals->maxClients; i++, cl++ )
|
||||
for( i = 0, cl = svs.clients; cl && i < svgame.globals->maxClients; i++, cl++ )
|
||||
{
|
||||
if( !cl->state )
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user