1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-23 01:59:43 +08:00

Further ConVar ABI fixes.

This commit is contained in:
Nick Hastings 2018-05-05 10:26:01 -04:00
parent 6e5b1bf250
commit 08c1461a88
2 changed files with 18 additions and 3 deletions

View File

@ -379,7 +379,7 @@ private:
// Called by CCvar when the value of a var is changing.
virtual void InternalSetValue(const char *value);
// For CVARs marked FCVAR_NEVER_AS_STRING
virtual void InternalSetFloatValue( float fNewValue );
virtual void InternalSetFloatValue( float fNewValue, bool bForce = false );
virtual void InternalSetIntValue( int nValue );
virtual bool ClampValue( float& value );
@ -416,6 +416,13 @@ private:
float m_fMinVal;
bool m_bHasMax;
float m_fMaxVal;
bool m_bHasCompMin;
float m_fCompMinVal;
bool m_bHasCompMax;
float m_fCompMaxVal;
bool m_bCompetitiveRestrictions;
// Call this function when ConVar changes
FnChangeCallback_t m_fnChangeCallback;

View File

@ -862,9 +862,9 @@ bool ConVar::ClampValue( float& value )
// Purpose:
// Input : *value -
//-----------------------------------------------------------------------------
void ConVar::InternalSetFloatValue( float fNewValue )
void ConVar::InternalSetFloatValue( float fNewValue, bool bForce /*= false */ )
{
if ( fNewValue == m_fValue )
if ( fNewValue == m_fValue && !bForce )
return;
if ( IsFlagSet( FCVAR_MATERIAL_THREAD_MASK ) )
@ -961,6 +961,14 @@ void ConVar::Create( const char *pName, const char *pDefaultValue, int flags /*=
m_fMinVal = fMin;
m_bHasMax = bMax;
m_fMaxVal = fMax;
// AM stubbed out just enough for ABI compat
m_bHasCompMin = false;
m_fCompMinVal = 0.0;
m_bHasCompMax = false;
m_fCompMaxVal = 0.0;
m_bCompetitiveRestrictions = false;
//
m_fnChangeCallback = callback;