From a4268681cc613c05e628a339a62a6ef26fbc7b3a Mon Sep 17 00:00:00 2001 From: FutureRave Date: Thu, 13 Oct 2022 22:31:08 +0100 Subject: [PATCH] Move dvar to anon namespace --- src/client/component/logger.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/component/logger.cpp b/src/client/component/logger.cpp index 1c26f46..cd17ff2 100644 --- a/src/client/component/logger.cpp +++ b/src/client/component/logger.cpp @@ -13,6 +13,8 @@ namespace logger { utils::hook::detour com_error_hook; + game::dvar_t* logger_dev = nullptr; + void print_error(const char* msg, ...) { char buffer[2048]{}; @@ -79,7 +81,6 @@ namespace logger void print_dev(const char* msg, ...) { - static const auto* logger_dev = game::Dvar_RegisterBool("logger_dev", false, game::DVAR_FLAG_SAVED, "Print dev stuff"); if (!logger_dev->current.enabled) { return; @@ -162,6 +163,8 @@ namespace logger // Make havok script's print function actually print utils::hook::jump(0x140701A1C, print); + + logger_dev = game::Dvar_RegisterBool("logger_dev", false, game::DVAR_FLAG_SAVED, "Print dev stuff"); } }; }