diff --git a/src/Components/Modules/Dvar.cpp b/src/Components/Modules/Dvar.cpp index aaa34ca9..e9126362 100644 --- a/src/Components/Modules/Dvar.cpp +++ b/src/Components/Modules/Dvar.cpp @@ -402,6 +402,11 @@ namespace Components // remove write protection from fs_game Utils::Hook::Xor(0x6431EA, Game::DVAR_INIT); + // cheat protect g_hardcore + Utils::Hook::Xor(0x5E374F, Game::DVAR_CHEAT); + Utils::Hook::Xor(0x4D3689, Game::DVAR_CHEAT); + Utils::Hook::Xor(0x4197C3, Game::DVAR_CHEAT); + // set cg_fov max to 160.0 // because that's the max on SP static float cg_Fov = 160.0f; diff --git a/src/Components/Modules/Flags.cpp b/src/Components/Modules/Flags.cpp index 87400340..a41a942f 100644 --- a/src/Components/Modules/Flags.cpp +++ b/src/Components/Modules/Flags.cpp @@ -6,9 +6,9 @@ namespace Components bool Flags::HasFlag(const std::string& flag) { - Flags::ParseFlags(); + ParseFlags(); - for (const auto& entry : Flags::EnabledFlags) + for (const auto& entry : EnabledFlags) { if (Utils::String::ToLower(entry) == Utils::String::ToLower(flag)) { @@ -40,7 +40,7 @@ namespace Components if (wFlag[0] == L'-') { wFlag.erase(wFlag.begin()); - Flags::EnabledFlags.emplace_back(Utils::String::Convert(wFlag)); + EnabledFlags.emplace_back(Utils::String::Convert(wFlag)); } } @@ -48,9 +48,9 @@ namespace Components } // Workaround for wine - if (Utils::IsWineEnvironment() && Dedicated::IsEnabled() && !Flags::HasFlag("console") && !Flags::HasFlag("stdout")) + if (Utils::IsWineEnvironment() && Dedicated::IsEnabled() && !HasFlag("console") && !HasFlag("stdout")) { - Flags::EnabledFlags.emplace_back("stdout"); + EnabledFlags.emplace_back("stdout"); } } } diff --git a/src/Components/Modules/UIScript.cpp b/src/Components/Modules/UIScript.cpp index 08534954..36abb50f 100644 --- a/src/Components/Modules/UIScript.cpp +++ b/src/Components/Modules/UIScript.cpp @@ -116,11 +116,6 @@ namespace Components } } - bool UIScript::CL_IsUIActive_Hk(const int localClientNum) - { - return Game::Key_IsCatcherActive(localClientNum, Game::KEYCATCH_UI) || Game::cgsArray->hardcore; - } - UIScript::UIScript() { AssertSize(Game::uiInfo_s, 0x22FC); @@ -132,8 +127,6 @@ namespace Components // Install ownerdraw handler Utils::Hook(0x63D233, OwnerDrawHandleKeyStub, HOOK_CALL).install()->quick(); - - Utils::Hook(0x62B397, CL_IsUIActive_Hk, HOOK_CALL).install()->quick(); } UIScript::~UIScript() diff --git a/src/Components/Modules/UIScript.hpp b/src/Components/Modules/UIScript.hpp index dfbe2cee..553e15ab 100644 --- a/src/Components/Modules/UIScript.hpp +++ b/src/Components/Modules/UIScript.hpp @@ -36,8 +36,6 @@ namespace Components static bool RunMenuScript(const char* name, const char** args); static void RunMenuScriptStub(); - static bool CL_IsUIActive_Hk(int localClientNum); - static std::unordered_map UIScripts; static std::unordered_map> UIOwnerDraws; };