mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: cvar: consolidate auto description for GLCONFIG cvars
Fix bug when GLCONFIG cvars didn't had it's respective CLIENTDLL or GAMEUIDLL flags
This commit is contained in:
parent
2ef3d78d9f
commit
d177b6f528
@ -900,9 +900,7 @@ cvar_t *pfnCvar_RegisterClientVariable( const char *szName, const char *szValue,
|
||||
if( !Q_stricmp( szName, "motdfile" ))
|
||||
flags |= FCVAR_PRIVILEGED;
|
||||
|
||||
if( FBitSet( flags, FCVAR_GLCONFIG ))
|
||||
return (cvar_t *)Cvar_Get( szName, szValue, flags, va( CVAR_GLCONFIG_DESCRIPTION, szName ));
|
||||
return (cvar_t *)Cvar_Get( szName, szValue, flags|FCVAR_CLIENTDLL, Cvar_BuildAutoDescription( flags|FCVAR_CLIENTDLL ));
|
||||
return (cvar_t *)Cvar_Get( szName, szValue, flags|FCVAR_CLIENTDLL, Cvar_BuildAutoDescription( szName, flags|FCVAR_CLIENTDLL ));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -913,9 +911,7 @@ pfnCvar_RegisterVariable
|
||||
*/
|
||||
cvar_t *pfnCvar_RegisterGameUIVariable( const char *szName, const char *szValue, int flags )
|
||||
{
|
||||
if( FBitSet( flags, FCVAR_GLCONFIG ))
|
||||
return (cvar_t *)Cvar_Get( szName, szValue, flags, va( CVAR_GLCONFIG_DESCRIPTION, szName ));
|
||||
return (cvar_t *)Cvar_Get( szName, szValue, flags|FCVAR_GAMEUIDLL, Cvar_BuildAutoDescription( flags|FCVAR_GAMEUIDLL ));
|
||||
return (cvar_t *)Cvar_Get( szName, szValue, flags|FCVAR_GAMEUIDLL, Cvar_BuildAutoDescription( szName, flags|FCVAR_GAMEUIDLL ));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -95,10 +95,16 @@ Cvar_BuildAutoDescription
|
||||
build cvar auto description that based on the setup flags
|
||||
============
|
||||
*/
|
||||
const char *Cvar_BuildAutoDescription( int flags )
|
||||
const char *Cvar_BuildAutoDescription( const char *szName, int flags )
|
||||
{
|
||||
static char desc[256];
|
||||
|
||||
if( FBitSet( flags, FCVAR_GLCONFIG ))
|
||||
{
|
||||
Q_snprintf( desc, sizeof( desc ), CVAR_GLCONFIG_DESCRIPTION, szName );
|
||||
return desc;
|
||||
}
|
||||
|
||||
desc[0] = '\0';
|
||||
|
||||
if( FBitSet( flags, FCVAR_EXTDLL ))
|
||||
@ -1187,7 +1193,7 @@ void Cvar_List_f( void )
|
||||
|
||||
if( FBitSet( var->flags, FCVAR_EXTENDED|FCVAR_ALLOCATED ))
|
||||
Con_Printf( " %-*s %s ^3%s^7\n", 32, var->name, value, var->desc );
|
||||
else Con_Printf( " %-*s %s ^3%s^7\n", 32, var->name, value, Cvar_BuildAutoDescription( var->flags ));
|
||||
else Con_Printf( " %-*s %s ^3%s^7\n", 32, var->name, value, Cvar_BuildAutoDescription( var->name, var->flags ));
|
||||
|
||||
count++;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ void Cvar_FullSet( const char *var_name, const char *value, int flags );
|
||||
void Cvar_DirectSet( convar_t *var, const char *value );
|
||||
void Cvar_Set( const char *var_name, const char *value );
|
||||
void Cvar_SetValue( const char *var_name, float value );
|
||||
const char *Cvar_BuildAutoDescription( int flags );
|
||||
const char *Cvar_BuildAutoDescription( const char *szName, int flags );
|
||||
float Cvar_VariableValue( const char *var_name );
|
||||
int Cvar_VariableInteger( const char *var_name );
|
||||
const char *Cvar_VariableString( const char *var_name );
|
||||
|
Loading…
x
Reference in New Issue
Block a user