-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEntity.cpp
More file actions
67 lines (49 loc) · 1.41 KB
/
Entity.cpp
File metadata and controls
67 lines (49 loc) · 1.41 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Rainbow Six: Siege SDK
* Copyright (C) 2017 RangeMachine
*/
#include "Entity.h"
#include "Offsets.h"
#include "Memory.h"
namespace Engine
{
Vector3& Entity::GetPosition()
{
if (!Memory::IsValidPtr<Entity>(this))
return *(new Vector3());
return *Memory::Ptr<Vector3*>(this, OFFSET_ENTITY_POSITION);
}
Vector3& Entity::GetNeck()
{
if (!Memory::IsValidPtr<Entity>(this))
return *(new Vector3());
return *Memory::Ptr<Vector3*>(this, OFFSET_ENTITY_NECK);
}
Vector3& Entity::GetHead()
{
if (!Memory::IsValidPtr<Entity>(this))
return *(new Vector3());
return *Memory::Ptr<Vector3*>(this, OFFSET_ENTITY_HEAD);
}
Vector3& Entity::GetRightHand()
{
if (!Memory::IsValidPtr<Entity>(this))
return *(new Vector3());
return *Memory::Ptr<Vector3*>(this, OFFSET_ENTITY_RIGHTHAND);
}
Vector3& Entity::GetLeftHand()
{
if (!Memory::IsValidPtr<Entity>(this))
return *(new Vector3());
return *Memory::Ptr<Vector3*>(this, OFFSET_ENTITY_LEFTHAND);
}
float Entity::GetHealth()
{
if (!Memory::IsValidPtr<Entity>(this))
return 0.0f;
auto pEntityInfo = *Memory::Ptr<void**>(this, OFFSET_ENTITY_ENTITYINFO);
auto pMainComponent = *Memory::Ptr<void**>(pEntityInfo, OFFSET_ENTITYINFO_MAINCOMPONENT);
auto pChildComponent = *Memory::Ptr<void**>(pMainComponent, OFFSET_MAINCOMPONENT_CHILDCOMPONENT);
return *Memory::Ptr<float*>(pChildComponent, OFFSET_CHILDCOMPONENT_HEALTH);
}
}