From b3e5e1047339c45dadd091d0d19f864fa9a99e25 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sun, 11 Oct 2015 13:19:06 +0200 Subject: [PATCH] Fix retrieval of sv address not working under linux --- modules/cstrike/cstrike/CstrikeHacks.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/cstrike/cstrike/CstrikeHacks.cpp b/modules/cstrike/cstrike/CstrikeHacks.cpp index f81f804c..8c004eb3 100644 --- a/modules/cstrike/cstrike/CstrikeHacks.cpp +++ b/modules/cstrike/cstrike/CstrikeHacks.cpp @@ -524,22 +524,28 @@ void InitGlobalVars() uintptr_t base = *reinterpret_cast(reinterpret_cast(g_engfuncs.pfnGetCurrentPlayer) + typeDesc.fieldOffset); ServerStatic = reinterpret_cast(base - 4); } + + if (CommonConfig->GetAddress("sv", &address)) + { + Server = *reinterpret_cast(address); + } #else if (CommonConfig->GetMemSig("svs", &address)) { ServerStatic = reinterpret_cast(address); } -#endif - if (CommonConfig->GetAddress("sv", &address)) + + if (CommonConfig->GetMemSig("sv", &address)) { - Server = *reinterpret_cast(address); + Server = reinterpret_cast(address); } +#endif if (!ServerStatic) { MF_Log("svs global variable is not available\n"); } - + if (!Server) { MF_Log("sv global variable is not available\n");