-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentity.cpp
48 lines (37 loc) · 1000 Bytes
/
entity.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
41
42
43
44
45
46
47
48
#include "entity.hpp"
int gentities;
int ENTITY::getPlayerState() {
if(!this->base)
return 0;
return *(int*)(base+EOFF_PLAYERSTATE);
}
bool ENTITY::isPlayer() {
int client = *(int*)(base+EOFF_PLAYERSTATE);
return client;
}
bool ENTITY::isEntity() {
return((*(int*)this->base) == this->index);
}
void ENTITY::switchState() {
if(this->ps)
this->ptr = this->getPlayerState();
else
this->ptr = this->base;
this->ps = !this->ps;
}
void ENTITY::toPlayerState() {
this->ptr = this->getPlayerState();
this->ps = true;
}
void ENTITY::toEntityState() {
this->ptr = this->base;
this->ps = false;
}
void ENTITY::set(int offset, void* v, unsigned int len) {
memcpy((void*)(ptr+offset), v, len);
}
void ENTITY::get(int offset, void* v, unsigned int len) {
memcpy(v, (void*)(ptr+offset), len);
}
void G_Damage(int* targ, int* inflictor, int* attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod, int idk) {
}