-
Notifications
You must be signed in to change notification settings - Fork 20
/
hltvdirectorwrapper.cpp
40 lines (33 loc) · 1.05 KB
/
hltvdirectorwrapper.cpp
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
38
39
40
#include "hltvdirectorwrapper.h"
HLTVDirectorWrapper g_HLTVDirectorWrapper;
void HLTVDirectorWrapper::SetPVSEntity(int index)
{
static int offset = -1;
if (offset == -1 && !g_pGameConf->GetOffset("CHLTVDirector::m_iPVSEntity", &offset))
{
smutils->LogError(myself, "Failed to get CHLTVDirector::m_iPVSEntity offset.");
return;
}
*(int *)((intptr_t)hltvdirector + offset) = index;
}
void HLTVDirectorWrapper::SetPVSOrigin(Vector pos)
{
static int offset = -1;
if (offset == -1 && !g_pGameConf->GetOffset("CHLTVDirector::m_vPVSOrigin", &offset))
{
smutils->LogError(myself, "Failed to get CHLTVDirector::m_vPVSOrigin offset.");
return;
}
Vector *m_vPVSOrigin = (Vector *)((intptr_t)hltvdirector + offset);
*m_vPVSOrigin = pos;
}
void HLTVDirectorWrapper::SetNextThinkTick(int tick)
{
static int offset = -1;
if (offset == -1 && !g_pGameConf->GetOffset("CHLTVDirector::m_nNextShotTick", &offset))
{
smutils->LogError(myself, "Failed to get CHLTVDirector::m_nNextShotTick offset.");
return;
}
*(int *)((intptr_t)hltvdirector + offset) = tick;
}