mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Tier1: track convar value changes in ConVar::InternalSetValue too
Add the tracker call here too to allow for debugging changes and catching bugs. Remaned the function from TrackDefaultValue to TrackValueChange as its no longer exclusive to the create method.
This commit is contained in:
parent
bf7f128acf
commit
726b5c9fbc
@ -244,7 +244,7 @@ private:
|
||||
virtual void InternalSetColorValue(Color value);
|
||||
|
||||
// DoNothing in the engine, probably for tracking/debugging cvar strings in debug.
|
||||
virtual void TrackDefaultValue(const char* value) { };
|
||||
virtual void TrackValueChange(const char* value) { };
|
||||
|
||||
virtual bool ClampValue(float& flValue);
|
||||
|
||||
|
@ -680,6 +680,10 @@ void ConVar::InternalSetValue(const char* value)
|
||||
m_Value.m_nValue = (int)(m_Value.m_fValue);
|
||||
}
|
||||
|
||||
// Note(amos): send the value that can potentially be null,
|
||||
// since we want to track those too
|
||||
TrackValueChange(value);
|
||||
|
||||
if (!(m_nFlags & FCVAR_NEVER_AS_STRING))
|
||||
{
|
||||
ChangeStringValue(newVal);
|
||||
@ -1020,7 +1024,7 @@ void ConVar::Create(const char* pName, const char* pDefaultValue, int flags /*=
|
||||
}
|
||||
|
||||
|
||||
TrackDefaultValue(m_Value.m_pszString);
|
||||
TrackValueChange(m_Value.m_pszString);
|
||||
|
||||
// Only 1 of the 2 can be set on a ConVar, both means there is a bug in
|
||||
// your code, fix it!
|
||||
|
Loading…
x
Reference in New Issue
Block a user