From b3026a7991c0c2c29e3b4699294006605cb1f33d Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 13 Jun 2024 01:19:38 +0300 Subject: [PATCH] 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 --- engine/client/cl_main.c | 2 +- engine/client/in_touch.c | 4 ++-- engine/client/s_load.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 76d36731..36d341ca 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -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 diff --git a/engine/client/in_touch.c b/engine/client/in_touch.c index d804297a..abc656d7 100644 --- a/engine/client/in_touch.c +++ b/engine/client/in_touch.c @@ -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; diff --git a/engine/client/s_load.c b/engine/client/s_load.c index 559da2dd..e73edced 100644 --- a/engine/client/s_load.c +++ b/engine/client/s_load.c @@ -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] == '*' )