Fix retrieval of sv address not working under linux
This commit is contained in:
parent
2eeeb2997d
commit
b3e5e10473
@ -524,16 +524,22 @@ 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)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user