Fix getting IDemoRecorder in CS:GO linux

This commit is contained in:
Peace-Maker 2016-10-15 16:59:04 -06:00
parent 3aa53e4baf
commit 7fb0e7bf23
2 changed files with 18 additions and 1 deletions

View File

@ -430,13 +430,20 @@ IDemoRecorder *HLTVServerWrapperManager::GetDemoRecorderPtr(IHLTVServer *hltv)
}
*(int **)&offset = (int *)addr;
// See if we have to subtract something from the offset.
int baseOffset = 0;
if (g_pGameConf->GetOffset("CHLTVDemoRecorder_BaseOffset", &baseOffset))
{
offset -= baseOffset;
}
}
if (hltv)
{
IServer *baseServer = hltv->GetBaseServer();
#ifndef WIN32
return (IDemoRecorder *)((intptr_t)baseServer + offset - 4);
return (IDemoRecorder *)((intptr_t)baseServer + offset);
#else
#if SOURCE_ENGINE == SE_CSGO
return (IDemoRecorder *)((intptr_t)hltv + offset);

View File

@ -91,6 +91,11 @@
"windows" "52"
"linux" "52"
}
"CHLTVDemoRecorder_BaseOffset"
{
"windows" "0"
"linux" "12"
}
}
"Signatures"
{
@ -245,6 +250,11 @@
"windows" "40"
"linux" "40"
}
"CHLTVDemoRecorder_BaseOffset"
{
"windows" "0"
"linux" "4"
}
}
"Signatures"
{