mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2026-10-10 11:53:05 +08:00
Update KeyValues src with latest tf2 change
Co-authored-by: ficool2 <34815548+ficool2@users.noreply.github.com>
This commit is contained in:
+21
-5
@@ -461,9 +461,9 @@ void KeyValues::Init()
|
||||
|
||||
m_bHasEscapeSequences = false;
|
||||
m_bEvaluateConditionals = true;
|
||||
m_bLocalStorage = false;
|
||||
|
||||
// for future proof
|
||||
memset( unused, 0, sizeof(unused) );
|
||||
m_pStringTable = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -528,7 +528,10 @@ void KeyValues::ChainKeyValue( KeyValues* pChain )
|
||||
//-----------------------------------------------------------------------------
|
||||
const char *KeyValues::GetName( void ) const
|
||||
{
|
||||
return s_pfGetStringForSymbol( m_iKeyName );
|
||||
if ( m_bLocalStorage )
|
||||
return m_pStringTable->GetStringForSymbol( m_iKeyName );
|
||||
else
|
||||
return s_pfGetStringForSymbol( m_iKeyName );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1001,7 +1004,9 @@ KeyValues *KeyValues::FindKey(const char *keyName, bool bCreate)
|
||||
}
|
||||
|
||||
// lookup the symbol for the search string
|
||||
HKeySymbol iSearchStr = s_pfGetSymbolForString( searchStr, bCreate );
|
||||
HKeySymbol iSearchStr = m_bLocalStorage
|
||||
? m_pStringTable->GetSymbolForString( searchStr, bCreate )
|
||||
: s_pfGetSymbolForString( searchStr, bCreate );
|
||||
|
||||
if ( iSearchStr == INVALID_KEY_SYMBOL )
|
||||
{
|
||||
@@ -1730,7 +1735,18 @@ void KeyValues::SetFloat( const char *keyName, float value )
|
||||
|
||||
void KeyValues::SetName( const char * setName )
|
||||
{
|
||||
m_iKeyName = s_pfGetSymbolForString( setName, true );
|
||||
if ( m_bLocalStorage )
|
||||
m_iKeyName = m_pStringTable->GetSymbolForString( setName );
|
||||
else
|
||||
m_iKeyName = s_pfGetSymbolForString( setName, true );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
bool KeyValues::IsUsingLocalStorage() const
|
||||
{
|
||||
return m_bLocalStorage != 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user