diff --git a/src/client/component/getinfo.cpp b/src/client/component/getinfo.cpp index 1deb6826..496db001 100644 --- a/src/client/component/getinfo.cpp +++ b/src/client/component/getinfo.cpp @@ -109,7 +109,7 @@ namespace getinfo info.set("protocol", utils::string::va("%i", PROTOCOL)); info.set("playmode", utils::string::va("%i", game::Com_SessionMode_GetMode())); info.set("gamemode", utils::string::va("%i", Com_SessionMode_GetGameMode())); - //info.set("sv_running", utils::string::va("%i", get_dvar_bool("sv_running"))); + info.set("sv_running", utils::string::va("%i", game::get_dvar_bool("sv_running"))); info.set("dedicated", utils::string::va("%i", game::is_server() ? 1 : 0)); info.set("shortversion", SHORTVERSION); diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 7d41fc0e..94887b58 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -105,10 +105,15 @@ namespace game WEAK symbol Dvar_DisplayableValue{0x1422BC080}; WEAK symbol Dvar_GetBool{0x1422BCED0}; WEAK symbol Dvar_GetInt{0x0, 0x140575C20}; + WEAK symbol Dvar_GetFLoat{0x0, 0x140575B20}; WEAK symbol Dvar_RegisterBool{ 0x1422D0900, 0x14057B500 }; + WEAK symbol Dvar_RegisterFloat{ + 0x0, 0x14057B6B0 + }; WEAK symbol Dvar_SessionModeRegisterBool{ 0x1422D0D40, 0x14057BAA0 diff --git a/src/client/game/utils.cpp b/src/client/game/utils.cpp index b33c08ef..74c650f1 100644 --- a/src/client/game/utils.cpp +++ b/src/client/game/utils.cpp @@ -83,6 +83,19 @@ namespace game return registered_dvar; } + const dvar_t* register_dvar_float(const char* dvar_name, float value, float min, float max, const int flags, const char* description) + { + const auto hash = Dvar_GenerateHash(dvar_name); + auto* registered_dvar = Dvar_RegisterFloat(hash, dvar_name, value, min, max, flags, description); + + if (registered_dvar) + { + registered_dvar->debugName = dvar_name; + } + + return registered_dvar; + } + const dvar_t* register_dvar_string(const char* dvar_name, const char* value, const int flags, const char* description) { const auto hash = Dvar_GenerateHash(dvar_name); diff --git a/src/client/game/utils.hpp b/src/client/game/utils.hpp index c59bbfc7..e08b9417 100644 --- a/src/client/game/utils.hpp +++ b/src/client/game/utils.hpp @@ -9,6 +9,7 @@ namespace game bool get_dvar_bool(const char* dvar_name); const dvar_t* register_dvar_bool(const char* dvar_name, bool value, int flags, const char* description); + const dvar_t* register_dvar_float(const char* dvar_name, float value, float min, float max, const int flags, const char* description); const dvar_t* register_sessionmode_dvar_bool(const char* dvar_name, bool value, int flags, const char* description, eModes mode = MODE_COUNT); const dvar_t* register_dvar_string(const char* dvar_name, const char* value, int flags, const char* description); void dvar_add_flags(const char* dvar, dvarFlags_e flags);