mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
Hack-fix ConVar / ConCommandBase.
Not sure what these new GetXVirtualized are for. They seem to have their own stored values, but were only added when Server-bounded convars were also touched (and implementing these).
This commit is contained in:
@ -139,6 +139,8 @@ public:
|
||||
|
||||
virtual bool IsCommand( void ) const;
|
||||
|
||||
virtual bool IsBoundedVar( void ) const;
|
||||
|
||||
// Check flag
|
||||
virtual bool IsFlagSet( int64 flag ) const;
|
||||
// Set flag
|
||||
@ -448,6 +450,9 @@ public:
|
||||
return m_Value;
|
||||
}
|
||||
|
||||
virtual float GetFloatVirtualized( void ) const;
|
||||
virtual int GetIntVirtualized( void ) const;
|
||||
virtual bool GetBoolVirtualized( void ) const;
|
||||
private:
|
||||
bool InternalSetColorFromString( const char *value );
|
||||
// Called by CCvar when the value of a var is changing.
|
||||
|
@ -310,6 +310,10 @@ bool ConCommandBase::IsRegistered( void ) const
|
||||
return m_bRegistered;
|
||||
}
|
||||
|
||||
bool ConCommandBase::IsBoundedVar(void) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
@ -939,6 +943,21 @@ void ConVar::InternalSetColorValue( Color cValue )
|
||||
InternalSetIntValue( color );
|
||||
}
|
||||
|
||||
bool ConVar::GetBoolVirtualized() const
|
||||
{
|
||||
return m_Value.m_nValue != 0;
|
||||
}
|
||||
|
||||
int ConVar::GetIntVirtualized() const
|
||||
{
|
||||
return m_Value.m_nValue;
|
||||
}
|
||||
|
||||
float ConVar::GetFloatVirtualized() const
|
||||
{
|
||||
return m_Value.m_fValue;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Private creation
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user