forked from psychonic/dodhooks
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvglobals.cpp
More file actions
38 lines (27 loc) · 737 Bytes
/
vglobals.cpp
File metadata and controls
38 lines (27 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "vglobals.h"
#include "extension.h"
void *g_pEntList = NULL;
void **g_pObjectiveResource = NULL;
void InitializeValveGlobals()
{
g_pEntList = g_pGameHelpers->GetGlobalEntityList();
uint8 *pAddress = NULL;
#ifdef PLATFORM_WINDOWS
int iOffset;
if (!g_pGameConf->GetMemSig("CreateStandardEntities", (void **)&pAddress) || !pAddress)
{
return;
}
if (!g_pGameConf->GetOffset("g_pObjectiveResource", &iOffset) || !iOffset)
{
return;
}
g_pObjectiveResource = *reinterpret_cast<void ***>(pAddress + iOffset);
#elif defined PLATFORM_LINUX
if (!g_pGameConf->GetMemSig("g_pObjectiveResource", (void **)&pAddress) || !pAddress)
{
return;
}
g_pObjectiveResource = reinterpret_cast<void **>(pAddress);
#endif
}