Fix retrieval of sv address not working under linux
This commit is contained in:
parent
2eeeb2997d
commit
b3e5e10473
|
@ -524,22 +524,28 @@ void InitGlobalVars()
|
||||||
uintptr_t base = *reinterpret_cast<uintptr_t*>(reinterpret_cast<byte*>(g_engfuncs.pfnGetCurrentPlayer) + typeDesc.fieldOffset);
|
uintptr_t base = *reinterpret_cast<uintptr_t*>(reinterpret_cast<byte*>(g_engfuncs.pfnGetCurrentPlayer) + typeDesc.fieldOffset);
|
||||||
ServerStatic = reinterpret_cast<server_static_t*>(base - 4);
|
ServerStatic = reinterpret_cast<server_static_t*>(base - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonConfig->GetAddress("sv", &address))
|
||||||
|
{
|
||||||
|
Server = *reinterpret_cast<server_t**>(address);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (CommonConfig->GetMemSig("svs", &address))
|
if (CommonConfig->GetMemSig("svs", &address))
|
||||||
{
|
{
|
||||||
ServerStatic = reinterpret_cast<server_static_t*>(address);
|
ServerStatic = reinterpret_cast<server_static_t*>(address);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (CommonConfig->GetAddress("sv", &address))
|
if (CommonConfig->GetMemSig("sv", &address))
|
||||||
{
|
{
|
||||||
Server = *reinterpret_cast<server_t**>(address);
|
Server = reinterpret_cast<server_t*>(address);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!ServerStatic)
|
if (!ServerStatic)
|
||||||
{
|
{
|
||||||
MF_Log("svs global variable is not available\n");
|
MF_Log("svs global variable is not available\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Server)
|
if (!Server)
|
||||||
{
|
{
|
||||||
MF_Log("sv global variable is not available\n");
|
MF_Log("sv global variable is not available\n");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user