Use ConVar::ChangeStringValue() instead for purging hostnames

Now possible without crashing with the new memalloc singleton.
This commit is contained in:
Kawe Mazidjatari 2022-07-22 17:18:54 +02:00
parent c7cd6b2971
commit 65cbdb5465

View File

@ -272,7 +272,7 @@ void ConVar::PurgeHostNames(void) const
{ {
if (ConVar* pCVar = g_pCVar->FindVar(pszHostNames[i])) if (ConVar* pCVar = g_pCVar->FindVar(pszHostNames[i]))
{ {
pCVar->ChangeStringValueUnsafe("0.0.0.0"); pCVar->ChangeStringValue("0.0.0.0", pCVar->m_Value.m_fValue);
} }
} }
} }
@ -776,7 +776,7 @@ void ConVar::ChangeStringValue(const char* pszTempVal, float flOldValue)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: changes the ConVar string value (unsafe). // Purpose: changes the ConVar string value (only use if the new string is equal or lower than this->m_iStringLength).
// Input : *pszTempVal - flOldValue // Input : *pszTempVal - flOldValue
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void ConVar::ChangeStringValueUnsafe(const char* pszNewValue) void ConVar::ChangeStringValueUnsafe(const char* pszNewValue)