From 8f921d971da1cacd00c0f709bea1c31f746b6aea Mon Sep 17 00:00:00 2001 From: Malifox <78408070+Malifox@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:47:11 -0500 Subject: [PATCH] Make finding the sv_lan ConVar a static operation (#2258) Co-authored-by: Malifox <78408070+Maliwolf@users.noreply.github.com> (cherry picked from commit 25faf18760a489ee147f4dd54bbd2d367a8d0da4) --- core/HalfLife2.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index f0e1013f7..e6ea60db0 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -57,7 +57,6 @@ typedef ICommandLine *(*FakeGetCommandLine)(); #define VSTDLIB_NAME FORMAT_SOURCE_BIN_NAME("vstdlib") CHalfLife2 g_HL2; -ConVar *sv_lan = NULL; static void *g_EntList = NULL; static void **g_pEntInfoList = NULL; @@ -787,7 +786,7 @@ void CHalfLife2::ProcessFakeCliCmdQueue() bool CHalfLife2::IsLANServer() { - sv_lan = icvar->FindVar("sv_lan"); + static ConVar *sv_lan = icvar->FindVar("sv_lan"); if (!sv_lan) {