-
Notifications
You must be signed in to change notification settings - Fork 0
/
takedamageinfohack.h
81 lines (70 loc) · 1.79 KB
/
takedamageinfohack.h
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef TAKEDAMAGEINFOHACK_H
#define TAKEDAMAGEINFOHACK_H
#ifdef _WIN32
# pragma once
#endif
#include "smsdk_ext.h"
#define GAME_DLL 1
#include <isaverestore.h>
#ifndef _DEBUG
# include <ehandle.h>
#else
# undef _DEBUG
# include <ehandle.h>
# define _DEBUG 1
#endif
#include <server_class.h>
#include <shareddefs.h>
#include <takedamageinfo.h>
class CTakeDamageInfoHack : public CTakeDamageInfo
{
public:
CTakeDamageInfoHack(CBaseEntity* pInflictor, CBaseEntity* pAttacker, float flDamage, int bitsDamageType,
CBaseEntity* pWeapon, Vector vecDamageForce, Vector vecDamagePosition);
int GetAttacker() const;
void SetAttacker(CBaseEntity* pAttacker);
inline int GetInflictor() const
{
return m_hInflictor.IsValid() ? m_hInflictor.GetEntryIndex() : -1;
}
inline int GetDamagedOtherPlayers() const
{
return m_iDamagedOtherPlayers;
}
inline int GetObjectsPenetrated() const
{
return m_iObjectsPenetrated;
}
#if SOURCE_ENGINE >= SE_ORANGEBOX && SOURCE_ENGINE != SE_LEFT4DEAD
inline int GetWeapon() const
{
return m_hWeapon.IsValid() ? m_hWeapon.GetEntryIndex() : -1;
}
#else
inline int GetWeapon() const
{
return -1;
}
inline void SetWeapon(CBaseEntity*)
{}
#endif
inline void SetDamageForce(vec_t x, vec_t y, vec_t z)
{
m_vecDamageForce.x = x;
m_vecDamageForce.y = y;
m_vecDamageForce.z = z;
}
inline void SetDamagePosition(vec_t x, vec_t y, vec_t z)
{
m_vecDamagePosition.x = x;
m_vecDamagePosition.y = y;
m_vecDamagePosition.z = z;
}
#if SOURCE_ENGINE < SE_ORANGEBOX
inline int GetDamageCustom() const
{
return GetCustomKill();
}
#endif
};
#endif // TAKEDAMAGEINFOHACK_H