Skip to content

Commit

Permalink
refactor: correct variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisAMJ committed Aug 18, 2024
1 parent 699ab35 commit 0e61bef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/cvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
|sar_find_ents|cmd|sar_find_ents \<selector> - finds entities in the entity list by class name|
|sar_find_server_class|cmd|sar_find_server_class \<class_name> - finds specific server class tables and props with their offset|
|<i title="Portal Reloaded">sar_fix_reloaded_cheats</i>|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 \<id> - 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 \<fov> - forces player FOV|
Expand Down
6 changes: 3 additions & 3 deletions src/Modules/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Server::_AcceptInput>(ent, Offsets::AcceptInput);

g_AcceptInputHook.SetFunc(server->AcceptInput);
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 0e61bef

Please sign in to comment.