From 0e61bef9a23dceee2f8cc84b9667316989734ae9 Mon Sep 17 00:00:00 2001 From: Jesse <69196954+ThisAMJ@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:31:21 +1000 Subject: [PATCH] refactor: correct variable name --- docs/cvars.md | 1 + src/Modules/Server.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/cvars.md b/docs/cvars.md index bbab6bd94..142662ca0 100644 --- a/docs/cvars.md +++ b/docs/cvars.md @@ -206,6 +206,7 @@ |sar_find_ents|cmd|sar_find_ents \ - finds entities in the entity list by class name| |sar_find_server_class|cmd|sar_find_server_class \ - finds specific server class tables and props with their offset| |sar_fix_reloaded_cheats|1|Overrides map execution of specific console commands in Reloaded in order to separate map usage from player usage for these commands.| +|sar_fix_viewmodel_bug|0|Fixes the viewmodel seemingly randomly disappearing.| |sar_font_get_name|cmd|sar_font_get_name \ - gets the name of a font from its index| |sar_font_list|cmd|sar_font_list - lists all available fonts| |sar_force_fov|cmd|sar_force_fov \ - forces player FOV| diff --git a/src/Modules/Server.cpp b/src/Modules/Server.cpp index 1565999d2..ac448c8fd 100644 --- a/src/Modules/Server.cpp +++ b/src/Modules/Server.cpp @@ -635,12 +635,12 @@ static void __cdecl AcceptInput_Hook(void *thisptr, const char *inputName, void // because we need a reference to an entity vtable to find the address // of CBaseEntity::AcceptInput, but we generally can't do that until // we've loaded into a level. -static bool IsAcceptInputTrampolineInitialized = false; +static bool g_IsAcceptInputTrampolineInitialized = false; Hook g_AcceptInputHook(&AcceptInput_Hook); static void InitAcceptInputTrampoline() { void *ent = server->m_EntPtrArray[0].m_pEntity; if (ent == nullptr) return; - IsAcceptInputTrampolineInitialized = true; + g_IsAcceptInputTrampolineInitialized = true; server->AcceptInput = Memory::VMT(ent, Offsets::AcceptInput); g_AcceptInputHook.SetFunc(server->AcceptInput); @@ -673,7 +673,7 @@ static void InitPlayerRunCommandHook() { } ON_EVENT(SESSION_START) { - if (!IsAcceptInputTrampolineInitialized) InitAcceptInputTrampoline(); + if (!g_IsAcceptInputTrampolineInitialized) InitAcceptInputTrampoline(); if (!g_IsCMFlagHookInitialized && sv_bonus_challenge.GetBool()) InitCMFlagHook(); if (!g_IsPlayerRunCommandHookInitialized) InitPlayerRunCommandHook(); }