From ff5bb1f264fafb0f66ed5f754686bfbb81d1e4e0 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Tue, 31 Aug 2021 18:12:25 +0200 Subject: [PATCH] Use Dvar_SetString --- src/Components/Modules/Dvar.cpp | 2 +- src/Game/Functions.cpp | 2 ++ src/Game/Functions.hpp | 9 ++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Components/Modules/Dvar.cpp b/src/Components/Modules/Dvar.cpp index 1410616c..a5debd80 100644 --- a/src/Components/Modules/Dvar.cpp +++ b/src/Components/Modules/Dvar.cpp @@ -88,7 +88,7 @@ namespace Components { if (this->dvar && this->dvar->type == Game::dvar_type::DVAR_TYPE_STRING) { - Game::Dvar_SetCommand(this->dvar->name, string); + Game::Dvar_SetString(this->dvar, string); } } void Dvar::Var::set(const std::string& string) diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index 8b46ac76..265adc00 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -279,6 +279,8 @@ namespace Game Dvar_SetFromStringByName_t Dvar_SetFromStringByName = Dvar_SetFromStringByName_t(0x4F52E0); Dvar_SetFromStringByNameFromSource_t Dvar_SetFromStringByNameFromSource = Dvar_SetFromStringByNameFromSource_t(0x4FC770); Dvar_SetStringByName_t Dvar_SetStringByName = Dvar_SetStringByName_t(0x44F060); + Dvar_SetString_t Dvar_SetString = Dvar_SetString_t(0x4A9580); + SL_ConvertToString_t SL_ConvertToString = SL_ConvertToString_t(0x4EC1D0); SL_GetString_t SL_GetString = SL_GetString_t(0x4CDC10); diff --git a/src/Game/Functions.hpp b/src/Game/Functions.hpp index f0945356..04dbe436 100644 --- a/src/Game/Functions.hpp +++ b/src/Game/Functions.hpp @@ -235,15 +235,18 @@ namespace Game typedef dvar_t* (__cdecl * Dvar_RegisterColor_t)(const char* name, float r, float g, float b, float a, int flags, const char* description); extern Dvar_RegisterColor_t Dvar_RegisterColor; - typedef dvar_t*(__cdecl * Dvar_SetFromStringByName_t)(const char* cvar, const char* value); + typedef dvar_t* (__cdecl * Dvar_SetFromStringByName_t)(const char* cvar, const char* value); extern Dvar_SetFromStringByName_t Dvar_SetFromStringByName; - typedef dvar_t*(__cdecl * Dvar_SetFromStringByNameFromSource_t)(const char* cvar, const char* value, DvarSetSource source); + typedef dvar_t* (__cdecl * Dvar_SetFromStringByNameFromSource_t)(const char* cvar, const char* value, DvarSetSource source); extern Dvar_SetFromStringByNameFromSource_t Dvar_SetFromStringByNameFromSource; - typedef void(__cdecl * Dvar_SetStringByName_t)(const char* cvar, const char* value); + typedef void (__cdecl * Dvar_SetStringByName_t)(const char* cvar, const char* value); extern Dvar_SetStringByName_t Dvar_SetStringByName; + typedef void (__cdecl * Dvar_SetString_t)(dvar_t* cvar, const char* value); + extern Dvar_SetString_t Dvar_SetString; + typedef void(__cdecl * Dvar_GetUnpackedColorByName_t)(const char* name, float* color); extern Dvar_GetUnpackedColorByName_t Dvar_GetUnpackedColorByName;