engine: client: don't use CL_Active/CL_GetMaxClients wrappers as they are only intended to be either passed to DLL or used in common/server code

This commit is contained in:
Alibek Omarov 2024-06-13 01:19:38 +03:00
parent 0a051832a8
commit b3026a7991
3 changed files with 4 additions and 4 deletions

View file

@ -116,7 +116,7 @@ qboolean CL_IsInGame( void )
if( host.type == HOST_DEDICATED )
return true; // always active for dedicated servers
if( cl.background || CL_GetMaxClients() > 1 )
if( cl.background || cl.maxclients > 1 )
return true; // always active for multiplayer or background map
return ( cls.key_dest == key_game ); // active if not menu or console

View file

@ -1217,10 +1217,10 @@ static qboolean Touch_IsVisible( touch_button_t *button )
if( FBitSet( button->flags, TOUCH_FL_HIDE ))
return false; // skip hidden
if( FBitSet( button->flags, TOUCH_FL_SP ) && CL_GetMaxClients() != 1 )
if( FBitSet( button->flags, TOUCH_FL_SP ) && cl.maxclients != 1 )
return false; // skip singleplayer(load, save) buttons in multiplayer
if( FBitSet( button->flags, TOUCH_FL_MP ) && CL_GetMaxClients() == 1 )
if( FBitSet( button->flags, TOUCH_FL_MP ) && cl.maxclients == 1 )
return false; // skip multiplayer buttons in singleplayer
return true;

View file

@ -144,7 +144,7 @@ wavdata_t *S_LoadSound( sfx_t *sfx )
if( Q_stricmp( sfx->name, "*default" ))
{
// load it from disk
if( s_warn_late_precache.value > 0 && CL_Active() )
if( s_warn_late_precache.value > 0 && cls.state == ca_active )
Con_Printf( S_WARN "S_LoadSound: late precache of %s\n", sfx->name );
if( sfx->name[0] == '*' )