1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00

Update ICvar, ConVarData & ConVarValueInfo_t

This commit is contained in:
GAMMACASE
2025-08-15 02:38:48 +03:00
parent 3525af9943
commit e0e3380c9f
3 changed files with 80 additions and 14 deletions

View File

@ -599,24 +599,27 @@ void ConVarRefAbstract::SetValueInternal( CSplitScreenSlot slot, CVValue_t *valu
CVValue_t prev;
TypeTraits()->Construct( &prev );
TypeTraits()->Copy( &prev, *curr_value );
TypeTraits()->Destruct( curr_value );
TypeTraits()->Construct( curr_value );
TypeTraits()->Copy( curr_value, *value );
m_ConVarData->Clamp( slot );
if(!m_ConVarData->IsEqual( slot, &prev ))
if(g_pCVar->CallFilterCallback( *this, slot, value, &prev ))
{
CBufferString prev_str, new_str;
TypeTraits()->Destruct( curr_value );
TypeTraits()->ValueToString( &prev, prev_str );
TypeTraits()->ValueToString( curr_value, new_str );
TypeTraits()->Construct( curr_value );
TypeTraits()->Copy( curr_value, *value );
m_ConVarData->Clamp( slot );
m_ConVarData->IncrementTimesChanged();
if(!m_ConVarData->IsEqual( slot, &prev ))
{
CBufferString prev_str, new_str;
CallChangeCallbacks( slot, curr_value, &prev, new_str.Get(), prev_str.Get() );
TypeTraits()->ValueToString( &prev, prev_str );
TypeTraits()->ValueToString( curr_value, new_str );
m_ConVarData->IncrementTimesChanged();
CallChangeCallbacks( slot, curr_value, &prev, new_str.Get(), prev_str.Get() );
}
}
TypeTraits()->Destruct( &prev );