partial un-static
This commit is contained in:
parent
6be676abde
commit
61189c1bce
@ -56,8 +56,8 @@ int draw::width = 0;
|
|||||||
int draw::height = 0;
|
int draw::height = 0;
|
||||||
|
|
||||||
int colors::EntityF(CachedEntity* ent) {
|
int colors::EntityF(CachedEntity* ent) {
|
||||||
static int result, skin, plclr;
|
int result, skin, plclr;
|
||||||
static k_EItemType type;
|
k_EItemType type;
|
||||||
|
|
||||||
using namespace colors;
|
using namespace colors;
|
||||||
result = white;
|
result = white;
|
||||||
@ -123,8 +123,8 @@ int colors::RainbowCurrent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int colors::FromHSL(float h, float s, float v) {
|
int colors::FromHSL(float h, float s, float v) {
|
||||||
static double hh, p, q, t, ff;
|
double hh, p, q, t, ff;
|
||||||
static long i;
|
long i;
|
||||||
|
|
||||||
if(s <= 0.0) { // < is bogus, just shuts up warnings
|
if(s <= 0.0) { // < is bogus, just shuts up warnings
|
||||||
return colors::Create(v * 255, v * 255, v * 255, 255);
|
return colors::Create(v * 255, v * 255, v * 255, 255);
|
||||||
@ -157,7 +157,7 @@ int colors::FromHSL(float h, float s, float v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int colors::Health(int health, int max) {
|
int colors::Health(int health, int max) {
|
||||||
static float hf;
|
float hf;
|
||||||
hf = (float)health / (float)max;
|
hf = (float)health / (float)max;
|
||||||
if (hf > 1) {
|
if (hf > 1) {
|
||||||
return colors::Create(64, 128, 255, 255);
|
return colors::Create(64, 128, 255, 255);
|
||||||
@ -218,8 +218,8 @@ void draw::DrawLine(int x, int y, int dx, int dy, int color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool draw::EntityCenterToScreen(CachedEntity* entity, Vector& out) {
|
bool draw::EntityCenterToScreen(CachedEntity* entity, Vector& out) {
|
||||||
static Vector world, min, max;
|
Vector world, min, max;
|
||||||
static bool succ;
|
bool succ;
|
||||||
|
|
||||||
if (!entity) return false;
|
if (!entity) return false;
|
||||||
RAW_ENT(entity)->GetRenderBounds(min, max);
|
RAW_ENT(entity)->GetRenderBounds(min, max);
|
||||||
@ -230,7 +230,7 @@ bool draw::EntityCenterToScreen(CachedEntity* entity, Vector& out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool draw::WorldToScreen(Vector& origin, Vector& screen) {
|
bool draw::WorldToScreen(Vector& origin, Vector& screen) {
|
||||||
static float w, odw;
|
float w, odw;
|
||||||
|
|
||||||
const VMatrix& wts = g_IEngine->WorldToScreenMatrix();
|
const VMatrix& wts = g_IEngine->WorldToScreenMatrix();
|
||||||
screen.z = 0;
|
screen.z = 0;
|
||||||
@ -250,18 +250,18 @@ void draw::OutlineRect(int x, int y, int w, int h, int color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void draw::GetStringLength(unsigned long font, char* string, int& length, int& height) {
|
void draw::GetStringLength(unsigned long font, char* string, int& length, int& height) {
|
||||||
static wchar_t buf[512];
|
wchar_t buf[512];
|
||||||
memset(buf, 0, sizeof(wchar_t) * 512);
|
memset(buf, 0, sizeof(wchar_t) * 512);
|
||||||
mbstowcs(buf, string, strlen(string));
|
mbstowcs(buf, string, strlen(string));
|
||||||
g_ISurface->GetTextSize(font, buf, length, height);
|
g_ISurface->GetTextSize(font, buf, length, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw::String (unsigned long font, int x, int y, int color, int shadow, const char* text) {
|
void draw::String (unsigned long font, int x, int y, int color, int shadow, const char* text) {
|
||||||
static bool newlined;
|
bool newlined;
|
||||||
static int w, h, s, n;
|
int w, h, s, n;
|
||||||
static char ch[512];
|
char ch[512];
|
||||||
static wchar_t string[512];
|
wchar_t string[512];
|
||||||
static size_t len;
|
size_t len;
|
||||||
|
|
||||||
newlined = false;
|
newlined = false;
|
||||||
len = strlen(text);
|
len = strlen(text);
|
||||||
@ -297,8 +297,8 @@ void draw::String(unsigned long font, int x, int y, int color, int shadow, std::
|
|||||||
}
|
}
|
||||||
CatVar fast_outline(CV_SWITCH, "fast_outline", "0", "Fast font outline", "Use only single repaint to increase performance");
|
CatVar fast_outline(CV_SWITCH, "fast_outline", "0", "Fast font outline", "Use only single repaint to increase performance");
|
||||||
void draw::WString(unsigned long font, int x, int y, int color, int shadow, const wchar_t* text) {
|
void draw::WString(unsigned long font, int x, int y, int color, int shadow, const wchar_t* text) {
|
||||||
static unsigned char alpha;
|
unsigned char alpha;
|
||||||
static int black_t;
|
int black_t;
|
||||||
|
|
||||||
if (shadow) {
|
if (shadow) {
|
||||||
alpha = (color >> 24);
|
alpha = (color >> 24);
|
||||||
|
@ -37,9 +37,9 @@ void EntityHitboxCache::Update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EntityHitboxCache::Init() {
|
void EntityHitboxCache::Init() {
|
||||||
static model_t *model;
|
model_t *model;
|
||||||
static studiohdr_t *shdr;
|
studiohdr_t *shdr;
|
||||||
static mstudiohitboxset_t *set;
|
mstudiohitboxset_t *set;
|
||||||
|
|
||||||
m_bInit = true;
|
m_bInit = true;
|
||||||
model = 0;
|
model = 0;
|
||||||
@ -64,7 +64,7 @@ void EntityHitboxCache::Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EntityHitboxCache::VisibilityCheck(int id) {
|
bool EntityHitboxCache::VisibilityCheck(int id) {
|
||||||
static CachedHitbox *hitbox;
|
CachedHitbox *hitbox;
|
||||||
|
|
||||||
if (!m_bInit) Init();
|
if (!m_bInit) Init();
|
||||||
if (id < 0 || id >= m_nNumHitboxes) return 0;
|
if (id < 0 || id >= m_nNumHitboxes) return 0;
|
||||||
@ -92,7 +92,7 @@ void EntityHitboxCache::Reset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CachedHitbox* EntityHitboxCache::GetHitbox(int id) {
|
CachedHitbox* EntityHitboxCache::GetHitbox(int id) {
|
||||||
static mstudiobbox_t *box;
|
mstudiobbox_t *box;
|
||||||
|
|
||||||
if (!m_bInit) Init();
|
if (!m_bInit) Init();
|
||||||
if (id < 0 || id >= m_nNumHitboxes) return 0;
|
if (id < 0 || id >= m_nNumHitboxes) return 0;
|
||||||
|
@ -120,8 +120,8 @@ CachedEntity* CurrentTarget() {
|
|||||||
|
|
||||||
int ClosestHitbox(CachedEntity* target) {
|
int ClosestHitbox(CachedEntity* target) {
|
||||||
// FIXME this will break multithreading if it will be ever implemented. When implementing it, these should be made non-static
|
// FIXME this will break multithreading if it will be ever implemented. When implementing it, these should be made non-static
|
||||||
static int closest;
|
int closest;
|
||||||
static float closest_fov, fov;
|
float closest_fov, fov;
|
||||||
|
|
||||||
//If you can see the spine, no need to check for another hitbox
|
//If you can see the spine, no need to check for another hitbox
|
||||||
if ((int)hitbox_mode == 0) {
|
if ((int)hitbox_mode == 0) {
|
||||||
@ -140,11 +140,11 @@ int ClosestHitbox(CachedEntity* target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CreateMove() {
|
void CreateMove() {
|
||||||
static EAimbotLocalState local_state;
|
EAimbotLocalState local_state;
|
||||||
static float target_highest_score, scr, begincharge, charge;
|
float target_highest_score, scr, begincharge, charge;
|
||||||
static CachedEntity* ent;
|
CachedEntity* ent;
|
||||||
static EAimbotTargetState tg;
|
EAimbotTargetState tg;
|
||||||
static int huntsman_ticks = 0;
|
int huntsman_ticks = 0;
|
||||||
|
|
||||||
target_highest = 0;
|
target_highest = 0;
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
@ -307,11 +307,11 @@ bool VischeckPredictedEntity(CachedEntity* entity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EAimbotTargetState TargetState(CachedEntity* entity) {
|
EAimbotTargetState TargetState(CachedEntity* entity) {
|
||||||
static float bdmg;
|
float bdmg;
|
||||||
static weaponmode mode;
|
weaponmode mode;
|
||||||
static Vector resultAim;
|
Vector resultAim;
|
||||||
static int hitbox;
|
int hitbox;
|
||||||
static int team;
|
int team;
|
||||||
|
|
||||||
if (entity->m_Type == ENTITY_PLAYER) {
|
if (entity->m_Type == ENTITY_PLAYER) {
|
||||||
if (entity == LOCAL_E) return EAimbotTargetState::LOCAL;
|
if (entity == LOCAL_E) return EAimbotTargetState::LOCAL;
|
||||||
@ -458,9 +458,9 @@ void slowAim(Vector &inputAngle, Vector userAngle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Aim(CachedEntity* entity) {
|
bool Aim(CachedEntity* entity) {
|
||||||
static Vector angles, tr;
|
Vector angles, tr;
|
||||||
static int hitbox, weapon_class;
|
int hitbox, weapon_class;
|
||||||
static bool attack;
|
bool attack;
|
||||||
static int forbiddenWeapons[] = { g_pClassID->CTFCompoundBow, g_pClassID->CTFKnife };
|
static int forbiddenWeapons[] = { g_pClassID->CTFCompoundBow, g_pClassID->CTFKnife };
|
||||||
|
|
||||||
state = EAimbotState::AIMING;
|
state = EAimbotState::AIMING;
|
||||||
@ -544,7 +544,7 @@ void UpdateAutoShootTimer() {
|
|||||||
bool UpdateAimkey() {
|
bool UpdateAimkey() {
|
||||||
static bool aimkey_flip = false;
|
static bool aimkey_flip = false;
|
||||||
static bool pressed_last_tick = false;
|
static bool pressed_last_tick = false;
|
||||||
static bool key_down;
|
bool key_down;
|
||||||
if (aimkey && aimkey_mode) {
|
if (aimkey && aimkey_mode) {
|
||||||
key_down = g_IInputSystem->IsButtonDown((ButtonCode_t)(int)aimkey);
|
key_down = g_IInputSystem->IsButtonDown((ButtonCode_t)(int)aimkey);
|
||||||
switch (static_cast<EAimKeyMode>((int)aimkey_mode)) {
|
switch (static_cast<EAimKeyMode>((int)aimkey_mode)) {
|
||||||
@ -582,8 +582,8 @@ float EffectiveShootingRange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EAimbotLocalState ShouldAim() {
|
EAimbotLocalState ShouldAim() {
|
||||||
static bool do_minigun_checks;
|
bool do_minigun_checks;
|
||||||
static int weapon_state;
|
int weapon_state;
|
||||||
// Checks should be in order: cheap -> expensive
|
// Checks should be in order: cheap -> expensive
|
||||||
if (attack_only && !(g_pUserCmd->buttons & IN_ATTACK)) {
|
if (attack_only && !(g_pUserCmd->buttons & IN_ATTACK)) {
|
||||||
return EAimbotLocalState::NOT_ATTACKING;
|
return EAimbotLocalState::NOT_ATTACKING;
|
||||||
@ -658,9 +658,9 @@ EAimbotLocalState ShouldAim() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int BestHitbox(CachedEntity* target) {
|
int BestHitbox(CachedEntity* target) {
|
||||||
static int preferred, ci, flags, bdmg;
|
int preferred, ci, flags, bdmg;
|
||||||
static float cdmg;
|
float cdmg;
|
||||||
static bool ground;
|
bool ground;
|
||||||
preferred = hitbox;
|
preferred = hitbox;
|
||||||
switch ((int)hitbox_mode) {
|
switch ((int)hitbox_mode) {
|
||||||
case 0: { // AUTO-HEAD
|
case 0: { // AUTO-HEAD
|
||||||
|
@ -25,8 +25,8 @@ void SayNope() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float GetAngle(CachedEntity* spy) {
|
float GetAngle(CachedEntity* spy) {
|
||||||
static float yaw, yaw2, anglediff;
|
float yaw, yaw2, anglediff;
|
||||||
static Vector diff;
|
Vector diff;
|
||||||
yaw = g_pLocalPlayer->v_OrigViewangles.y;
|
yaw = g_pLocalPlayer->v_OrigViewangles.y;
|
||||||
const Vector& A = LOCAL_E->m_vecOrigin;
|
const Vector& A = LOCAL_E->m_vecOrigin;
|
||||||
const Vector& B = spy->m_vecOrigin;
|
const Vector& B = spy->m_vecOrigin;
|
||||||
@ -41,8 +41,8 @@ float GetAngle(CachedEntity* spy) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CachedEntity* ClosestSpy() {
|
CachedEntity* ClosestSpy() {
|
||||||
static CachedEntity *closest, *ent;
|
CachedEntity *closest, *ent;
|
||||||
static float closest_dist, dist;
|
float closest_dist, dist;
|
||||||
|
|
||||||
closest = nullptr;
|
closest = nullptr;
|
||||||
closest_dist = 0.0f;
|
closest_dist = 0.0f;
|
||||||
@ -68,9 +68,9 @@ CachedEntity* ClosestSpy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CreateMove() {
|
void CreateMove() {
|
||||||
static CachedEntity *spy;
|
CachedEntity *spy;
|
||||||
static Vector diff;
|
Vector diff;
|
||||||
static float yaw2, resultangle;
|
float yaw2, resultangle;
|
||||||
|
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
spy = ClosestSpy();
|
spy = ClosestSpy();
|
||||||
|
@ -15,7 +15,7 @@ namespace hacks { namespace tf2 { namespace antidisguise {
|
|||||||
CatVar enabled(CV_SWITCH, "antidisguise", "0", "Remove spy disguise", "Removes the disguise from spys\nUsefull for aimbot");
|
CatVar enabled(CV_SWITCH, "antidisguise", "0", "Remove spy disguise", "Removes the disguise from spys\nUsefull for aimbot");
|
||||||
|
|
||||||
void Draw() {
|
void Draw() {
|
||||||
static CachedEntity *ent;
|
CachedEntity *ent;
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
for (int i = 0; i < 32 && i < HIGHEST_ENTITY; i++) {
|
for (int i = 0; i < 32 && i < HIGHEST_ENTITY; i++) {
|
||||||
ent = ENTITY(i);
|
ent = ENTITY(i);
|
||||||
|
@ -40,7 +40,7 @@ bool IsTarget(CachedEntity* ent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool stickyVisable(CachedEntity* targetTrace, CachedEntity* bombTrace) {
|
bool stickyVisable(CachedEntity* targetTrace, CachedEntity* bombTrace) {
|
||||||
static trace_t trace;
|
trace_t trace;
|
||||||
trace::filter_default.SetSelf(RAW_ENT(bombTrace));
|
trace::filter_default.SetSelf(RAW_ENT(bombTrace));
|
||||||
Ray_t ray;
|
Ray_t ray;
|
||||||
ray.Init(bombTrace->m_vecOrigin, RAW_ENT(targetTrace)->GetCollideable()->GetCollisionOrigin());
|
ray.Init(bombTrace->m_vecOrigin, RAW_ENT(targetTrace)->GetCollideable()->GetCollisionOrigin());
|
||||||
|
@ -68,9 +68,9 @@ void AddEntityString(CachedEntity* entity, const std::string& string, int color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CreateMove() {
|
void CreateMove() {
|
||||||
static int limit;
|
int limit;
|
||||||
static int max_clients = g_IEngine->GetMaxClients();
|
static int max_clients = g_IEngine->GetMaxClients();
|
||||||
static CachedEntity* ent;
|
CachedEntity* ent;
|
||||||
|
|
||||||
ResetEntityStrings();
|
ResetEntityStrings();
|
||||||
limit = HIGHEST_ENTITY;
|
limit = HIGHEST_ENTITY;
|
||||||
@ -88,7 +88,7 @@ void CreateMove() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Draw() {
|
void Draw() {
|
||||||
static int limit;
|
int limit;
|
||||||
static int max_clients = g_IEngine->GetMaxClients();
|
static int max_clients = g_IEngine->GetMaxClients();
|
||||||
limit = HIGHEST_ENTITY;
|
limit = HIGHEST_ENTITY;
|
||||||
if (!buildings && !proj_esp && !item_esp) limit = min(max_clients, HIGHEST_ENTITY);
|
if (!buildings && !proj_esp && !item_esp) limit = min(max_clients, HIGHEST_ENTITY);
|
||||||
@ -109,13 +109,13 @@ static CatVar esp_3d_box_nodraw(CV_SWITCH, "esp_3d_box_nodraw", "0", "Invisible
|
|||||||
static CatVar esp_3d_box_healthbar(CV_SWITCH, "esp_3d_box_healthbar", "1", "Health bar", "Adds a health bar to the esp");
|
static CatVar esp_3d_box_healthbar(CV_SWITCH, "esp_3d_box_healthbar", "1", "Health bar", "Adds a health bar to the esp");
|
||||||
|
|
||||||
void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healthmax) {
|
void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healthmax) {
|
||||||
static Vector mins, maxs;
|
Vector mins, maxs;
|
||||||
static Vector points_r[8];
|
Vector points_r[8];
|
||||||
static Vector points[8];
|
Vector points[8];
|
||||||
static bool set, success, cloak;
|
bool set, success, cloak;
|
||||||
static float x, y, z;
|
float x, y, z;
|
||||||
static int hbh, max_x, max_y, min_x, min_y;
|
int hbh, max_x, max_y, min_x, min_y;
|
||||||
static CachedHitbox* hb;
|
CachedHitbox* hb;
|
||||||
|
|
||||||
set = false;
|
set = false;
|
||||||
success = true;
|
success = true;
|
||||||
@ -228,11 +228,11 @@ static CatVar box_nodraw(CV_SWITCH, "esp_box_nodraw", "0", "Invisible 2D Box", "
|
|||||||
static CatVar box_expand(CV_INT, "esp_box_expand", "0", "Expand 2D Box", "Expand 2D box by N units");
|
static CatVar box_expand(CV_INT, "esp_box_expand", "0", "Expand 2D Box", "Expand 2D box by N units");
|
||||||
|
|
||||||
void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) {
|
void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) {
|
||||||
static Vector min, max, origin, so, omin, omax, smin, smax;
|
Vector min, max, origin, so, omin, omax, smin, smax;
|
||||||
static float height, width, trf;
|
float height, width, trf;
|
||||||
static bool cloak;
|
bool cloak;
|
||||||
static int min_x, min_y, max_x, max_y, border, hp, hbh;
|
int min_x, min_y, max_x, max_y, border, hp, hbh;
|
||||||
static unsigned char alpha;
|
unsigned char alpha;
|
||||||
|
|
||||||
if (CE_BAD(ent)) return;
|
if (CE_BAD(ent)) return;
|
||||||
|
|
||||||
|
@ -142,7 +142,8 @@ static CatCommand invalidate_cookies("skinchanger_bite_cookie", "Bite Cookie", I
|
|||||||
|
|
||||||
void FrameStageNotify(int stage) {
|
void FrameStageNotify(int stage) {
|
||||||
static int my_weapon, handle, eid, *weapon_list;
|
static int my_weapon, handle, eid, *weapon_list;
|
||||||
static IClientEntity *entity, *my_weapon_ptr, *last_weapon_out = nullptr;
|
static IClientEntity *entity, *my_weapon_ptr;
|
||||||
|
static IClientEntity *last_weapon_out = nullptr;
|
||||||
|
|
||||||
if (stage != FRAME_NET_UPDATE_POSTDATAUPDATE_START) return;
|
if (stage != FRAME_NET_UPDATE_POSTDATAUPDATE_START) return;
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
@ -184,7 +185,7 @@ void FrameStageNotify(int stage) {
|
|||||||
static CatVar show_debug_info(CV_SWITCH, "skinchanger_debug", "1", "Debug Skinchanger");
|
static CatVar show_debug_info(CV_SWITCH, "skinchanger_debug", "1", "Debug Skinchanger");
|
||||||
|
|
||||||
void PaintTraverse() {
|
void PaintTraverse() {
|
||||||
static CAttributeList *list;
|
CAttributeList *list;
|
||||||
|
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
if (!show_debug_info) return;
|
if (!show_debug_info) return;
|
||||||
@ -310,8 +311,8 @@ void InvalidateCookie() {
|
|||||||
patched_weapon_cookie::patched_weapon_cookie(int entity) {}
|
patched_weapon_cookie::patched_weapon_cookie(int entity) {}
|
||||||
|
|
||||||
void patched_weapon_cookie::Update(int entity) {
|
void patched_weapon_cookie::Update(int entity) {
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
static CAttributeList *list;
|
CAttributeList *list;
|
||||||
|
|
||||||
ent = g_IEntityList->GetClientEntity(entity);
|
ent = g_IEntityList->GetClientEntity(entity);
|
||||||
if (!ent || ent->IsDormant()) return;
|
if (!ent || ent->IsDormant()) return;
|
||||||
@ -326,8 +327,8 @@ void patched_weapon_cookie::Update(int entity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool patched_weapon_cookie::Check() {
|
bool patched_weapon_cookie::Check() {
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
static CAttributeList *list;
|
CAttributeList *list;
|
||||||
|
|
||||||
if (!valid) return false;
|
if (!valid) return false;
|
||||||
ent = g_IEntityList->GetClientEntity(eidx);
|
ent = g_IEntityList->GetClientEntity(eidx);
|
||||||
@ -355,8 +356,8 @@ bool def_attribute_modifier::Default() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void def_attribute_modifier::Apply(int entity) {
|
void def_attribute_modifier::Apply(int entity) {
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
static CAttributeList *list;
|
CAttributeList *list;
|
||||||
|
|
||||||
ent = g_IEntityList->GetClientEntity(entity);
|
ent = g_IEntityList->GetClientEntity(entity);
|
||||||
if (!ent) return;
|
if (!ent) return;
|
||||||
|
@ -25,9 +25,9 @@ float last_say = 0.0f;
|
|||||||
|
|
||||||
|
|
||||||
void Draw() {
|
void Draw() {
|
||||||
static CachedEntity *closest_spy, *ent;
|
CachedEntity *closest_spy, *ent;
|
||||||
static float closest_spy_distance, distance;
|
float closest_spy_distance, distance;
|
||||||
static int spy_count;
|
int spy_count;
|
||||||
|
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
if (g_pLocalPlayer->life_state) return;
|
if (g_pLocalPlayer->life_state) return;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
std::vector<ConVar*> g_ConVars;
|
std::vector<ConVar*> g_ConVars;
|
||||||
FILE* hConVarsFile = 0;
|
FILE* hConVarsFile = 0;
|
||||||
void BeginConVars() {
|
void BeginConVars() {
|
||||||
static FILE *hAutoexec, *hMatchexec;
|
FILE *hAutoexec, *hMatchexec;
|
||||||
|
|
||||||
hConVarsFile = fopen(strfmt("%scfg/cat_defaults.cfg", g_pszTFPath), "w");
|
hConVarsFile = fopen(strfmt("%scfg/cat_defaults.cfg", g_pszTFPath), "w");
|
||||||
hAutoexec = fopen(strfmt("%scfg/cat_autoexec.cfg", g_pszTFPath), "r+");
|
hAutoexec = fopen(strfmt("%scfg/cat_autoexec.cfg", g_pszTFPath), "r+");
|
||||||
@ -52,10 +52,10 @@ void EndConVars() {
|
|||||||
|
|
||||||
// StackOverflow copypasta xddd
|
// StackOverflow copypasta xddd
|
||||||
void ReplaceString(char* target, char* what, char* with_what) {
|
void ReplaceString(char* target, char* what, char* with_what) {
|
||||||
static char buffer[1024] = { 0 };
|
char buffer[1024] = { 0 };
|
||||||
static char *insert_point;
|
char *insert_point;
|
||||||
static const char *tmp, *p;
|
const char *tmp, *p;
|
||||||
static size_t needle_len, repl_len;
|
size_t needle_len, repl_len;
|
||||||
buffer[0] = 0;
|
buffer[0] = 0;
|
||||||
insert_point = &buffer[0];
|
insert_point = &buffer[0];
|
||||||
tmp = target;
|
tmp = target;
|
||||||
@ -109,17 +109,9 @@ const char* GetBuildingName(CachedEntity* ent) {
|
|||||||
void format_internal(std::stringstream& stream) {}
|
void format_internal(std::stringstream& stream) {}
|
||||||
|
|
||||||
std::string WordWrap(std::string& in, int max, unsigned long font) {
|
std::string WordWrap(std::string& in, int max, unsigned long font) {
|
||||||
static std::stringstream result, line, wordstream, next;
|
std::stringstream result, line, wordstream, next;
|
||||||
static std::string word;
|
std::string word;
|
||||||
static char ch;
|
char ch;
|
||||||
result.str("");
|
|
||||||
result.clear();
|
|
||||||
line.str("");
|
|
||||||
line.clear();
|
|
||||||
wordstream.str("");
|
|
||||||
wordstream.clear();
|
|
||||||
next.str("");
|
|
||||||
next.clear();
|
|
||||||
for (int i = 0; i < in.size(); i++) {
|
for (int i = 0; i < in.size(); i++) {
|
||||||
ch = in.at(i);
|
ch = in.at(i);
|
||||||
if (ch == ' ' || ch == '\n') {
|
if (ch == ' ' || ch == '\n') {
|
||||||
@ -151,7 +143,7 @@ std::string WordWrap(std::string& in, int max, unsigned long font) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ReplaceString(std::string& input, const std::string& what, const std::string& with_what) {
|
void ReplaceString(std::string& input, const std::string& what, const std::string& with_what) {
|
||||||
static size_t index;
|
size_t index;
|
||||||
index = input.find(what);
|
index = input.find(what);
|
||||||
while (index != std::string::npos) {
|
while (index != std::string::npos) {
|
||||||
input.replace(index, what.size(), with_what);
|
input.replace(index, what.size(), with_what);
|
||||||
@ -177,7 +169,7 @@ powerup_type GetPowerupOnPlayer(CachedEntity* player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HasDarwins(CachedEntity* ent) {
|
bool HasDarwins(CachedEntity* ent) {
|
||||||
static int *hWeapons;
|
int *hWeapons;
|
||||||
if (CE_INT(ent, netvar.iClass) != tf_sniper) return false;
|
if (CE_INT(ent, netvar.iClass) != tf_sniper) return false;
|
||||||
hWeapons = (int*)((unsigned)(RAW_ENT(ent) + netvar.hMyWeapons));
|
hWeapons = (int*)((unsigned)(RAW_ENT(ent) + netvar.hMyWeapons));
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
@ -194,7 +186,7 @@ void VectorTransform (const float *in1, const matrix3x4_t& in2, float *out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GetHitbox(CachedEntity* entity, int hb, Vector& out) {
|
bool GetHitbox(CachedEntity* entity, int hb, Vector& out) {
|
||||||
static CachedHitbox *box;
|
CachedHitbox *box;
|
||||||
|
|
||||||
if (CE_BAD(entity)) return false;
|
if (CE_BAD(entity)) return false;
|
||||||
box = entity->hitboxes.GetHitbox(hb);
|
box = entity->hitboxes.GetHitbox(hb);
|
||||||
@ -204,7 +196,7 @@ bool GetHitbox(CachedEntity* entity, int hb, Vector& out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VectorAngles(Vector &forward, Vector &angles) {
|
void VectorAngles(Vector &forward, Vector &angles) {
|
||||||
static float tmp, yaw, pitch;
|
float tmp, yaw, pitch;
|
||||||
|
|
||||||
if(forward[1] == 0 && forward[0] == 0)
|
if(forward[1] == 0 && forward[0] == 0)
|
||||||
{
|
{
|
||||||
@ -303,8 +295,8 @@ char GetChar(ButtonCode_t button) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FixMovement(CUserCmd& cmd, Vector& viewangles) {
|
void FixMovement(CUserCmd& cmd, Vector& viewangles) {
|
||||||
static Vector movement, ang;
|
Vector movement, ang;
|
||||||
static float speed, yaw;
|
float speed, yaw;
|
||||||
movement.x = cmd.forwardmove;
|
movement.x = cmd.forwardmove;
|
||||||
movement.y = cmd.sidemove;
|
movement.y = cmd.sidemove;
|
||||||
movement.z = cmd.upmove;
|
movement.z = cmd.upmove;
|
||||||
@ -329,7 +321,7 @@ float RandFloatRange(float min, float max) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsEntityVisible(CachedEntity* entity, int hb) {
|
bool IsEntityVisible(CachedEntity* entity, int hb) {
|
||||||
static Vector hit;
|
Vector hit;
|
||||||
if (g_Settings.bInvalid) return false;
|
if (g_Settings.bInvalid) return false;
|
||||||
if (entity == g_pLocalPlayer->entity) return true;
|
if (entity == g_pLocalPlayer->entity) return true;
|
||||||
if (hb == -1) {
|
if (hb == -1) {
|
||||||
@ -341,8 +333,8 @@ bool IsEntityVisible(CachedEntity* entity, int hb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsEntityVectorVisible(CachedEntity* entity, Vector endpos) {
|
bool IsEntityVectorVisible(CachedEntity* entity, Vector endpos) {
|
||||||
static trace_t trace_object;
|
trace_t trace_object;
|
||||||
static Ray_t ray;
|
Ray_t ray;
|
||||||
|
|
||||||
if (g_Settings.bInvalid) return false;
|
if (g_Settings.bInvalid) return false;
|
||||||
if (entity == g_pLocalPlayer->entity) return true;
|
if (entity == g_pLocalPlayer->entity) return true;
|
||||||
@ -358,7 +350,7 @@ bool IsEntityVectorVisible(CachedEntity* entity, Vector endpos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vector GetBuildingPosition(CachedEntity* ent) {
|
Vector GetBuildingPosition(CachedEntity* ent) {
|
||||||
static Vector res;
|
Vector res;
|
||||||
res = ent->m_vecOrigin;
|
res = ent->m_vecOrigin;
|
||||||
if (ent->m_iClassID == g_pClassID->CObjectDispenser) res.z += 30;
|
if (ent->m_iClassID == g_pClassID->CObjectDispenser) res.z += 30;
|
||||||
if (ent->m_iClassID == g_pClassID->CObjectTeleporter) res.z += 8;
|
if (ent->m_iClassID == g_pClassID->CObjectTeleporter) res.z += 8;
|
||||||
@ -439,8 +431,8 @@ bool IsProjectileCrit(CachedEntity* ent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
weaponmode GetWeaponMode(CachedEntity* player) {
|
weaponmode GetWeaponMode(CachedEntity* player) {
|
||||||
static int weapon_handle, slot;
|
int weapon_handle, slot;
|
||||||
static CachedEntity *weapon;
|
CachedEntity *weapon;
|
||||||
|
|
||||||
if (CE_BAD(player)) return weapon_invalid;
|
if (CE_BAD(player)) return weapon_invalid;
|
||||||
weapon_handle = CE_INT(player, netvar.hActiveWeapon);
|
weapon_handle = CE_INT(player, netvar.hActiveWeapon);
|
||||||
@ -490,7 +482,7 @@ bool LineIntersectsBox(Vector& bmin, Vector& bmax, Vector& lmin, Vector& lmax) {
|
|||||||
|
|
||||||
// TODO FIX this function
|
// TODO FIX this function
|
||||||
bool GetProjectileData(CachedEntity* weapon, float& speed, float& gravity) {
|
bool GetProjectileData(CachedEntity* weapon, float& speed, float& gravity) {
|
||||||
static float rspeed, rgrav;
|
float rspeed, rgrav;
|
||||||
|
|
||||||
if (CE_BAD(weapon)) return false;
|
if (CE_BAD(weapon)) return false;
|
||||||
rspeed = 0.0f;
|
rspeed = 0.0f;
|
||||||
@ -558,8 +550,8 @@ bool Developer(CachedEntity* ent) {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
bool IsVectorVisible(Vector origin, Vector target) {
|
bool IsVectorVisible(Vector origin, Vector target) {
|
||||||
static trace_t trace_visible;
|
trace_t trace_visible;
|
||||||
static Ray_t ray;
|
Ray_t ray;
|
||||||
|
|
||||||
trace::filter_no_player.SetSelf(RAW_ENT(g_pLocalPlayer->entity));
|
trace::filter_no_player.SetSelf(RAW_ENT(g_pLocalPlayer->entity));
|
||||||
ray.Init(origin, target);
|
ray.Init(origin, target);
|
||||||
@ -568,11 +560,11 @@ bool IsVectorVisible(Vector origin, Vector target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WhatIAmLookingAt(int* result_eindex, Vector* result_pos) {
|
void WhatIAmLookingAt(int* result_eindex, Vector* result_pos) {
|
||||||
static Ray_t ray;
|
Ray_t ray;
|
||||||
static Vector forward;
|
Vector forward;
|
||||||
static float sp, sy, cp, cy;
|
float sp, sy, cp, cy;
|
||||||
static QAngle angle;
|
QAngle angle;
|
||||||
static trace_t trace;
|
trace_t trace;
|
||||||
|
|
||||||
trace::filter_default.SetSelf(RAW_ENT(g_pLocalPlayer->entity));
|
trace::filter_default.SetSelf(RAW_ENT(g_pLocalPlayer->entity));
|
||||||
g_IEngine->GetViewAngles(angle);
|
g_IEngine->GetViewAngles(angle);
|
||||||
@ -611,8 +603,8 @@ bool IsAmbassador(CachedEntity* entity) {
|
|||||||
|
|
||||||
// F1 c&p
|
// F1 c&p
|
||||||
Vector CalcAngle(Vector src, Vector dst) {
|
Vector CalcAngle(Vector src, Vector dst) {
|
||||||
static Vector AimAngles, delta;
|
Vector AimAngles, delta;
|
||||||
static float hyp;
|
float hyp;
|
||||||
delta = src - dst;
|
delta = src - dst;
|
||||||
hyp = sqrtf((delta.x * delta.x) + (delta.y * delta.y)); //SUPER SECRET IMPROVEMENT CODE NAME DONUT STEEL
|
hyp = sqrtf((delta.x * delta.x) + (delta.y * delta.y)); //SUPER SECRET IMPROVEMENT CODE NAME DONUT STEEL
|
||||||
AimAngles.x = atanf(delta.z / hyp) * RADPI;
|
AimAngles.x = atanf(delta.z / hyp) * RADPI;
|
||||||
@ -624,7 +616,7 @@ Vector CalcAngle(Vector src, Vector dst) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MakeVector(Vector angle, Vector& vector) {
|
void MakeVector(Vector angle, Vector& vector) {
|
||||||
static float pitch, yaw, tmp;
|
float pitch, yaw, tmp;
|
||||||
pitch = float(angle[0] * PI / 180);
|
pitch = float(angle[0] * PI / 180);
|
||||||
yaw = float(angle[1] * PI / 180);
|
yaw = float(angle[1] * PI / 180);
|
||||||
tmp = float(cos(pitch));
|
tmp = float(cos(pitch));
|
||||||
@ -634,8 +626,8 @@ void MakeVector(Vector angle, Vector& vector) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float GetFov(Vector angle, Vector src, Vector dst) {
|
float GetFov(Vector angle, Vector src, Vector dst) {
|
||||||
static Vector ang, aim;
|
Vector ang, aim;
|
||||||
static float mag, u_dot_v;
|
float mag, u_dot_v;
|
||||||
ang = CalcAngle(src, dst);
|
ang = CalcAngle(src, dst);
|
||||||
|
|
||||||
MakeVector(angle, aim);
|
MakeVector(angle, aim);
|
||||||
@ -652,7 +644,7 @@ bool CanHeadshot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CanShoot() {
|
bool CanShoot() {
|
||||||
static float servertime, nextattack;
|
float servertime, nextattack;
|
||||||
|
|
||||||
servertime = (float)(CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * g_GlobalVars->interval_per_tick;
|
servertime = (float)(CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * g_GlobalVars->interval_per_tick;
|
||||||
nextattack = CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextPrimaryAttack);
|
nextattack = CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextPrimaryAttack);
|
||||||
@ -668,7 +660,7 @@ Vector QAngleToVector(QAngle in) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AimAt(Vector origin, Vector target, CUserCmd* cmd) {
|
void AimAt(Vector origin, Vector target, CUserCmd* cmd) {
|
||||||
static Vector angles, tr;
|
Vector angles, tr;
|
||||||
tr = (target - origin);
|
tr = (target - origin);
|
||||||
VectorAngles(tr, angles);
|
VectorAngles(tr, angles);
|
||||||
fClampAngle(angles);
|
fClampAngle(angles);
|
||||||
@ -676,19 +668,19 @@ void AimAt(Vector origin, Vector target, CUserCmd* cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AimAtHitbox(CachedEntity* ent, int hitbox, CUserCmd* cmd) {
|
void AimAtHitbox(CachedEntity* ent, int hitbox, CUserCmd* cmd) {
|
||||||
static Vector r;
|
Vector r;
|
||||||
r = ent->m_vecOrigin;
|
r = ent->m_vecOrigin;
|
||||||
GetHitbox(ent, hitbox, r);
|
GetHitbox(ent, hitbox, r);
|
||||||
AimAt(g_pLocalPlayer->v_Eye, r, cmd);
|
AimAt(g_pLocalPlayer->v_Eye, r, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) {
|
bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) {
|
||||||
static trace_t trace_visible;
|
trace_t trace_visible;
|
||||||
static Ray_t ray;
|
Ray_t ray;
|
||||||
static Vector hit;
|
Vector hit;
|
||||||
static int ret;
|
int ret;
|
||||||
static bool correct_entity;
|
bool correct_entity;
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
trace::filter_penetration.SetSelf(RAW_ENT(g_pLocalPlayer->entity));
|
trace::filter_penetration.SetSelf(RAW_ENT(g_pLocalPlayer->entity));
|
||||||
trace::filter_penetration.Reset();
|
trace::filter_penetration.Reset();
|
||||||
ret = GetHitbox(entity, hb, hit);
|
ret = GetHitbox(entity, hb, hit);
|
||||||
|
@ -65,10 +65,10 @@ void End() {
|
|||||||
|
|
||||||
bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
|
bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
|
||||||
static CreateMove_t original_method = (CreateMove_t)hooks::clientmode.GetMethod(offsets::CreateMove());
|
static CreateMove_t original_method = (CreateMove_t)hooks::clientmode.GetMethod(offsets::CreateMove());
|
||||||
static bool time_replaced, ret, speedapplied;
|
bool time_replaced, ret, speedapplied;
|
||||||
static float curtime_old, servertime, speed, yaw;
|
float curtime_old, servertime, speed, yaw;
|
||||||
static Vector vsilent, ang;
|
Vector vsilent, ang;
|
||||||
static INetChannel* ch;
|
INetChannel* ch;
|
||||||
|
|
||||||
SEGV_BEGIN;
|
SEGV_BEGIN;
|
||||||
tickcount++;
|
tickcount++;
|
||||||
@ -143,7 +143,7 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
|
|||||||
#ifdef IPC_ENABLED
|
#ifdef IPC_ENABLED
|
||||||
static int team_joining_state = 0;
|
static int team_joining_state = 0;
|
||||||
static float last_jointeam_try = 0;
|
static float last_jointeam_try = 0;
|
||||||
static CachedEntity *found_entity, *ent;
|
CachedEntity *found_entity, *ent;
|
||||||
|
|
||||||
if (hacks::shared::followbot::bot) {
|
if (hacks::shared::followbot::bot) {
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
static bool hoovy_list[32] = { 0 };
|
static bool hoovy_list[32] = { 0 };
|
||||||
|
|
||||||
bool HasSandvichOut(CachedEntity* entity) {
|
bool HasSandvichOut(CachedEntity* entity) {
|
||||||
static int weapon_idx;
|
int weapon_idx;
|
||||||
static CachedEntity *weapon;
|
CachedEntity *weapon;
|
||||||
|
|
||||||
weapon_idx = CE_INT(entity, netvar.hActiveWeapon) & 0xFFF;
|
weapon_idx = CE_INT(entity, netvar.hActiveWeapon) & 0xFFF;
|
||||||
if (!(weapon_idx > 0 && weapon_idx < HIGHEST_ENTITY)) return false;
|
if (!(weapon_idx > 0 && weapon_idx < HIGHEST_ENTITY)) return false;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "sdk.h"
|
#include "sdk.h"
|
||||||
|
|
||||||
void LocalPlayer::Update() {
|
void LocalPlayer::Update() {
|
||||||
static CachedEntity *wep;
|
CachedEntity *wep;
|
||||||
|
|
||||||
entity_idx = g_IEngine->GetLocalPlayer();
|
entity_idx = g_IEngine->GetLocalPlayer();
|
||||||
entity = ENTITY(entity_idx);
|
entity = ENTITY(entity_idx);
|
||||||
@ -39,7 +39,7 @@ void LocalPlayer::Update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CachedEntity* LocalPlayer::weapon() {
|
CachedEntity* LocalPlayer::weapon() {
|
||||||
static int handle, eid;
|
int handle, eid;
|
||||||
|
|
||||||
if (CE_BAD(entity)) return 0;
|
if (CE_BAD(entity)) return 0;
|
||||||
handle = CE_INT(entity, netvar.hActiveWeapon);
|
handle = CE_INT(entity, netvar.hActiveWeapon);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
void TFPlayerResource::Update() {
|
void TFPlayerResource::Update() {
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
|
|
||||||
entity = 0;
|
entity = 0;
|
||||||
for (int i = 0; i < HIGHEST_ENTITY; i++) {
|
for (int i = 0; i < HIGHEST_ENTITY; i++) {
|
||||||
@ -21,8 +21,8 @@ void TFPlayerResource::Update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TFPlayerResource::GetMaxHealth(CachedEntity* player) {
|
int TFPlayerResource::GetMaxHealth(CachedEntity* player) {
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
static int idx;
|
int idx;
|
||||||
|
|
||||||
if (HL2DM) return 100;
|
if (HL2DM) return 100;
|
||||||
ent = g_IEntityList->GetClientEntity(entity);
|
ent = g_IEntityList->GetClientEntity(entity);
|
||||||
@ -33,8 +33,8 @@ int TFPlayerResource::GetMaxHealth(CachedEntity* player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TFPlayerResource::GetMaxBuffedHealth(CachedEntity* player) {
|
int TFPlayerResource::GetMaxBuffedHealth(CachedEntity* player) {
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
static int idx;
|
int idx;
|
||||||
|
|
||||||
if (!TF2) return GetMaxHealth(player);
|
if (!TF2) return GetMaxHealth(player);
|
||||||
ent = g_IEntityList->GetClientEntity(entity);
|
ent = g_IEntityList->GetClientEntity(entity);
|
||||||
@ -45,7 +45,7 @@ int TFPlayerResource::GetMaxBuffedHealth(CachedEntity* player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TFPlayerResource::GetTeam(int idx) {
|
int TFPlayerResource::GetTeam(int idx) {
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
|
|
||||||
if (idx >= 64 || idx < 0) return 0;
|
if (idx >= 64 || idx < 0) return 0;
|
||||||
ent = g_IEntityList->GetClientEntity(entity);
|
ent = g_IEntityList->GetClientEntity(entity);
|
||||||
@ -54,8 +54,8 @@ int TFPlayerResource::GetTeam(int idx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TFPlayerResource::GetClass(CachedEntity* player) {
|
int TFPlayerResource::GetClass(CachedEntity* player) {
|
||||||
static IClientEntity *ent;
|
IClientEntity *ent;
|
||||||
static int idx;
|
int idx;
|
||||||
|
|
||||||
ent = g_IEntityList->GetClientEntity(entity);
|
ent = g_IEntityList->GetClientEntity(entity);
|
||||||
if (!ent || ent->GetClientClass()->m_ClassID != (TF ? g_pClassID->CTFPlayerResource : g_pClassID->CPlayerResource)) return 0;
|
if (!ent || ent->GetClientClass()->m_ClassID != (TF ? g_pClassID->CTFPlayerResource : g_pClassID->CPlayerResource)) return 0;
|
||||||
|
@ -97,11 +97,11 @@ float DistanceToGround(CachedEntity* ent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float DistanceToGround(Vector origin) {
|
float DistanceToGround(Vector origin) {
|
||||||
static trace_t* ground_trace = new trace_t();
|
trace_t ground_trace;
|
||||||
Ray_t ray;
|
Ray_t ray;
|
||||||
Vector endpos = origin;
|
Vector endpos = origin;
|
||||||
endpos.z -= 8192;
|
endpos.z -= 8192;
|
||||||
ray.Init(origin, endpos);
|
ray.Init(origin, endpos);
|
||||||
g_ITrace->TraceRay(ray, MASK_PLAYERSOLID, &trace::filter_no_player, ground_trace);
|
g_ITrace->TraceRay(ray, MASK_PLAYERSOLID, &trace::filter_no_player, &ground_trace);
|
||||||
return 8192.0f * ground_trace->fraction;
|
return 8192.0f * ground_trace.fraction;
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ void trace::FilterDefault::SetSelf(IClientEntity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool trace::FilterDefault::ShouldHitEntity(IHandleEntity* handle, int mask) {
|
bool trace::FilterDefault::ShouldHitEntity(IHandleEntity* handle, int mask) {
|
||||||
static IClientEntity *entity;
|
IClientEntity *entity;
|
||||||
static ClientClass *clazz;
|
ClientClass *clazz;
|
||||||
|
|
||||||
if (!handle) return false;
|
if (!handle) return false;
|
||||||
entity = (IClientEntity*) handle;
|
entity = (IClientEntity*) handle;
|
||||||
@ -70,8 +70,8 @@ void trace::FilterNoPlayer::SetSelf(IClientEntity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool trace::FilterNoPlayer::ShouldHitEntity(IHandleEntity* handle, int mask) {
|
bool trace::FilterNoPlayer::ShouldHitEntity(IHandleEntity* handle, int mask) {
|
||||||
static IClientEntity *entity;
|
IClientEntity *entity;
|
||||||
static ClientClass *clazz;
|
ClientClass *clazz;
|
||||||
|
|
||||||
if (!handle) return false;
|
if (!handle) return false;
|
||||||
entity = (IClientEntity*) handle;
|
entity = (IClientEntity*) handle;
|
||||||
@ -110,8 +110,8 @@ void trace::FilterPenetration::SetSelf(IClientEntity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool trace::FilterPenetration::ShouldHitEntity(IHandleEntity* handle, int mask) {
|
bool trace::FilterPenetration::ShouldHitEntity(IHandleEntity* handle, int mask) {
|
||||||
static IClientEntity *entity;
|
IClientEntity *entity;
|
||||||
static ClientClass *clazz;
|
ClientClass *clazz;
|
||||||
|
|
||||||
if (!handle) return false;
|
if (!handle) return false;
|
||||||
entity = (IClientEntity*) handle;
|
entity = (IClientEntity*) handle;
|
||||||
|
Reference in New Issue
Block a user