engine: rename Host_IsLocalGame to Host_IsSinglePlayerGame to avoid confusion

This commit is contained in:
Alibek Omarov
2026-05-05 01:04:57 +05:00
parent eb79bc6b40
commit fdb59e990e
8 changed files with 14 additions and 11 deletions

View File

@@ -172,8 +172,8 @@ intptr_t CL_RenderGetParm( const int parm, const int arg, const qboolean checkRe
return cl.local.waterlevel;
case PARM_LOCAL_HEALTH:
return cl.local.health;
case PARM_LOCAL_GAME:
return Host_IsLocalGame();
case PARM_SINGLEPLAYER_GAME:
return Host_IsSinglePlayerGame();
case PARM_NUMENTITIES:
return pfnNumberOfEntities();
case PARM_GET_CLIENT_PTR:

View File

@@ -852,13 +852,15 @@ static inline connprotocol_t CL_Protocol( void )
}
#endif
static inline qboolean Host_IsLocalGame( void )
// true in singleplayer only but not specific to local game
static inline qboolean Host_IsSinglePlayerGame( void )
{
if( SV_Active( ))
return SV_GetMaxClients() == 1 ? true : false;
return CL_GetMaxClients() == 1 ? true : false;
}
// true when both server and client running on the same host
static inline qboolean Host_IsLocalClient( void )
{
return CL_Initialized( ) && SV_Initialized( ) ? true : false;

View File

@@ -513,7 +513,7 @@ static double Host_CalcFPS( void )
{
fps = CL_GetDemoFramerate();
}
else if( Host_IsLocalGame( ))
else if( Host_IsSinglePlayerGame( ))
{
if( !gl_vsync.value )
fps = host_maxfps.value;
@@ -642,9 +642,10 @@ static qboolean Host_FilterTime( double time )
oldtime = host.realtime;
// NOTE: allow only in singleplayer while demos are not active
if( host_framerate.value > 0.0f && Host_IsLocalGame() && !CL_IsPlaybackDemo() && !CL_IsRecordDemo( ))
if( host_framerate.value > 0.0f && Host_IsSinglePlayerGame() && !CL_IsPlaybackDemo() && !CL_IsRecordDemo( ))
host.frametime = bound( MIN_FRAMETIME, host_framerate.value * scale, MAX_FRAMETIME );
else host.frametime = bound( MIN_FRAMETIME, host.frametime, MAX_FRAMETIME );
else
host.frametime = bound( MIN_FRAMETIME, host.frametime, MAX_FRAMETIME );
return true;
}

View File

@@ -330,7 +330,7 @@ typedef enum
PARM_WATER_LEVEL = -8, // cl.local.water_level
PARM_GET_WORLD_PTR = -9, // world
PARM_LOCAL_HEALTH = -10, // cl.local.health
PARM_LOCAL_GAME = -11,
PARM_SINGLEPLAYER_GAME = -11, // was PARM_LOCAL_GAME
PARM_NUMENTITIES = -12, // local game only
PARM_GET_MOVEVARS_PTR = -13, // clgame.movevars
PARM_GET_PALETTE_PTR = -14, // clgame.palette

View File

@@ -1724,7 +1724,7 @@ static qboolean SV_ShouldUpdateUserinfo( sv_client_t *cl )
if( FBitSet( cl->flags, FCL_FAKECLIENT ))
return allow;
if( Host_IsLocalGame( ))
if( Host_IsSinglePlayerGame( ))
return allow;
// start from 1 second

View File

@@ -262,7 +262,7 @@ static void SV_CheckCmdTimes( void )
Cvar_SetValue( "sv_fps", MAX_FPS_HARD );
}
if( Host_IsLocalGame( ))
if( Host_IsSinglePlayerGame( ))
return;
if(( host.realtime - lastreset ) < 1.0 )

View File

@@ -2420,7 +2420,7 @@ static model_t *R_StudioSetupPlayerModel( int index )
state = &g_studio.player_models[index];
// g-cont: force for "dev-mode", non-local games and menu preview
if(( gpGlobals->developer || !ENGINE_GET_PARM( PARM_LOCAL_GAME ) || !FBitSet( RI.rvp.flags, RF_DRAW_WORLD ) ) && info->model[0] )
if(( gpGlobals->developer || !ENGINE_GET_PARM( PARM_SINGLEPLAYER_GAME ) || !FBitSet( RI.rvp.flags, RF_DRAW_WORLD ) ) && info->model[0] )
{
if( Q_strcmp( state->name, info->model ))
{

View File

@@ -2084,7 +2084,7 @@ static model_t *R_StudioSetupPlayerModel( int index )
state = &g_studio.player_models[index];
// g-cont: force for "dev-mode", non-local games and menu preview
if(( gpGlobals->developer || !ENGINE_GET_PARM( PARM_LOCAL_GAME ) || !FBitSet( RI.rvp.flags, RF_DRAW_WORLD )) && info->model[0] )
if(( gpGlobals->developer || !ENGINE_GET_PARM( PARM_SINGLEPLAYER_GAME ) || !FBitSet( RI.rvp.flags, RF_DRAW_WORLD )) && info->model[0] )
{
if( Q_strcmp( state->name, info->model ))
{