dsdfsdfsdf
This commit is contained in:
parent
76e436b35a
commit
7a9d69def2
@ -87,7 +87,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="followbot|copypasted|mem|sdk|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="targeting|followbot|copypasted|mem|sdk|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="followbot|mem" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/followbot"/>
|
||||
</sourceEntries>
|
||||
@ -138,7 +138,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="followbot|copypasted|mem|sdk|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="targeting|followbot|copypasted|mem|sdk|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="followbot|hacks|copypasted|mem|sdk" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/followbot"/>
|
||||
</sourceEntries>
|
||||
@ -228,7 +228,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="followbot|copypasted|mem|sdk|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="targeting|followbot|copypasted|mem|sdk|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="followbot|mem" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/followbot"/>
|
||||
</sourceEntries>
|
||||
|
10
uran/TODO
10
uran/TODO
@ -1,5 +1,7 @@
|
||||
MAX -> MIN priority
|
||||
|
||||
FIX Followbot Crash
|
||||
Huntsman autoshoot
|
||||
Ambassador CanHeadshot detection
|
||||
Triggerbot ignores vaccinator ubers
|
||||
Ambassador & Huntsman AutoHitbox fix
|
||||
@ -7,10 +9,18 @@ No AutoShoot (aimbot/trigger) on consumables and PDAs
|
||||
Improve Projectile Aimbot. A lot.
|
||||
Integrate SEGVCATCH
|
||||
Proper AutoHitbox
|
||||
Smoothe the smooth aim
|
||||
Jumping ProjAim
|
||||
Aim Key mode (inverse/normal/disabled)
|
||||
ESP Icons
|
||||
ESP Distance sort
|
||||
Don't Aim if can't shoot
|
||||
No aim when cloaked
|
||||
Show sapped buildings in ESP
|
||||
Make hacks respect Mannpower powerups and other conditions when calcuating damage, hitbox and prioritizing targets
|
||||
Fake Lag
|
||||
An option to ignore taunting enemies
|
||||
AutoSticky
|
||||
No AutoShoot when disguised
|
||||
Fixing NoZoom flickering
|
||||
Ambassador bodyshotting
|
||||
|
@ -46,6 +46,8 @@ void EntityVariables::Init() {
|
||||
this->vecPunchAngle = gNetvars.get_offset("DT_BasePlayer", "localdata", "m_Local", "m_vecPunchAngle");
|
||||
this->vecPunchAngleVel = gNetvars.get_offset("DT_BasePlayer", "localdata", "m_Local", "m_vecPunchAngleVel");
|
||||
this->iItemDefinitionIndex = gNetvars.get_offset("DT_EconEntity", "m_AttributeManager", "m_Item", "m_iItemDefinitionIndex");
|
||||
this->flChargeBeginTime = gNetvars.get_offset("DT_WeaponPipebombLauncher", "PipebombLauncherLocalData", "m_flChargeBeginTime");
|
||||
this->flLastFireTime = gNetvars.get_offset("DT_TFWeaponBase", "LocalActiveTFWeaponData", "m_flLastFireTime");
|
||||
}
|
||||
|
||||
void InitEntityOffsets() {
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
class IClientEntity;
|
||||
|
||||
// TODO globals
|
||||
typedef unsigned int offset_t;
|
||||
|
||||
template<typename T>
|
||||
@ -30,6 +29,8 @@ void SetEntityValue(IClientEntity* ent, unsigned int offset, T value) {
|
||||
|
||||
void InitEntityOffsets();
|
||||
|
||||
// TODO move this.
|
||||
|
||||
class EntityVariables {
|
||||
public:
|
||||
void Init();
|
||||
@ -69,6 +70,9 @@ public:
|
||||
|
||||
offset_t vecPunchAngle;
|
||||
offset_t vecPunchAngleVel;
|
||||
|
||||
offset_t flChargeBeginTime;
|
||||
offset_t flLastFireTime;
|
||||
};
|
||||
|
||||
// TODO globals
|
||||
|
@ -6,14 +6,12 @@
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
//#include <string>
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
#include "fixsdk.h"
|
||||
#include <tier1/convar.h>
|
||||
|
||||
// TODO globals
|
||||
pthread_mutex_t mutex_quit;
|
||||
pthread_t thread_main;
|
||||
|
||||
|
@ -85,11 +85,6 @@ void hack::Hk_OverrideView(void* thisptr, CViewSetup* setup) {
|
||||
}
|
||||
|
||||
void hack::Hk_PaintTraverse(void* p, unsigned int vp, bool fr, bool ar) {
|
||||
// TODO move it into PrePT hook
|
||||
|
||||
//if (v_bNoZoom->GetBool()) {
|
||||
//}
|
||||
|
||||
((PaintTraverse_t*)hooks::hkPaintTraverse->GetMethod(hooks::offPaintTraverse))(p, vp, fr, ar);
|
||||
if (!draw::width || !draw::height) {
|
||||
interfaces::engineClient->GetScreenSize(draw::width, draw::height);
|
||||
@ -150,19 +145,12 @@ bool hack::Hk_CreateMove(void* thisptr, float inputSample, CUserCmd* cmd) {
|
||||
g_pLocalPlayer->v_OrigViewangles = cmd->viewangles;
|
||||
gEntityCache.Update();
|
||||
|
||||
//logging::Info("Inside CreateMove");
|
||||
//g_pLocalPlayer->bUseSilentAngles = false;
|
||||
//logging::Info("Inside CreateMove #1");
|
||||
for (IHack* i_hack : hack::hacks) {
|
||||
//PROF_BEGIN();
|
||||
if (!i_hack->CreateMove(thisptr, inputSample, cmd)) {
|
||||
ret = false;
|
||||
//g_pLocalPlayer->bUseSilentAngles = true;
|
||||
}
|
||||
//PROF_END(strfmt("%s CreateMove", i_hack->GetName()));
|
||||
}
|
||||
hack::invalidated = false;
|
||||
//logging::Info("Inside CreateMove #2");
|
||||
if (g_pLocalPlayer->bUseSilentAngles) {
|
||||
Vector vsilent(cmd->forwardmove, cmd->sidemove, cmd->upmove);
|
||||
float speed = sqrt(vsilent.x * vsilent.x + vsilent.y * vsilent.y);
|
||||
@ -173,19 +161,9 @@ bool hack::Hk_CreateMove(void* thisptr, float inputSample, CUserCmd* cmd) {
|
||||
cmd->sidemove = sin(yaw) * speed;
|
||||
return false;
|
||||
}
|
||||
//logging::Info("Inside CreateMove #3");
|
||||
//logging::Info("viewangles: %f, %f, %f", cmd->viewangles.x, cmd->viewangles.y, cmd->viewangles.z);
|
||||
//QAngle a;
|
||||
//a.x = g_pLocalPlayer->v_OrigViewangles.x;
|
||||
//a.y = g_pLocalPlayer->v_OrigViewangles.y;
|
||||
//a.z = g_pLocalPlayer->v_OrigViewangles.z;
|
||||
//interfaces::engineClient->SetViewAngles(a);
|
||||
//g_pLocalPlayer->bAttackLastTick = (cmd->buttons & (IN_ATTACK | IN_ATTACK2 | IN_USE));
|
||||
//logging::Info("Inside CreateMove #4");
|
||||
return ret;
|
||||
}
|
||||
|
||||
// TODO globals
|
||||
std::vector<IHack*> hack::hacks;
|
||||
bool hack::shutdown = false;
|
||||
|
||||
@ -193,7 +171,6 @@ void hack::AddHack(IHack* hack) {
|
||||
hack::hacks.push_back(hack);
|
||||
}
|
||||
|
||||
// TODO globals
|
||||
ICvar* g_pCVar = 0;
|
||||
|
||||
|
||||
|
@ -37,6 +37,7 @@ bool IsReflectableProjectile(IClientEntity* ent) {
|
||||
case ClassID::CTFProjectile_Rocket:
|
||||
case ClassID::CTFProjectile_SentryRocket:
|
||||
case ClassID::CTFGrenadePipebombProjectile:
|
||||
case ClassID::CTFProjectile_EnergyBall:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <cdll_int.h>
|
||||
#include <gametrace.h>
|
||||
#include <engine/IEngineTrace.h>
|
||||
#include <globalvars_base.h>
|
||||
#include <inputsystem/iinputsystem.h>
|
||||
#include "../sdk/in_buttons.h"
|
||||
|
||||
@ -62,6 +63,9 @@ HAimbot::HAimbot() {
|
||||
this->v_bSmooth = CreateConVar("u_aimbot_smooth", "0", "Smooth aimbot");
|
||||
this->v_fSmoothValue = CreateConVar("u_aimbot_smooth_value", "5.0", "Smooth value");
|
||||
this->v_iAimKey = CreateConVar("u_aimbot_aimkey", "0", "Aim Key");
|
||||
this->v_bAmbassador = CreateConVar("u_aimbot_ambassador", "0", "Ambassador mode."); // TODO
|
||||
v_bAimBuildings = CreateConVar("u_aimbot_buildings", "1", "Aim at buildings");
|
||||
v_bActiveOnlyWhenCanShoot = CreateConVar("u_aimbot_only_when_can_shoot", "1", "Aimbot active only when can shoot");
|
||||
fix_silent = false;
|
||||
}
|
||||
|
||||
@ -76,6 +80,8 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
if (this->v_bActiveOnlyWhenCanShoot->GetBool() && !BulletTime()) return true;
|
||||
|
||||
if (this->v_bEnabledAttacking->GetBool() && !(cmd->buttons & IN_ATTACK)) {
|
||||
return true;
|
||||
}
|
||||
@ -89,6 +95,15 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
if (this->v_bAmbassador->GetBool()) {
|
||||
// TODO defindex check
|
||||
if (g_pLocalPlayer->weapon && g_pLocalPlayer->weapon->GetClientClass()->m_ClassID == ClassID::CTFRevolver) {
|
||||
if ((interfaces::gvars->curtime - GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flLastFireTime)) <= 0.95) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(cmd->buttons & IN_USE) return true;
|
||||
|
||||
if (g_pLocalPlayer->bIsReloading) {
|
||||
@ -127,7 +142,7 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) {
|
||||
if (g_pLocalPlayer->weapon->GetClientClass()->m_ClassID == 210) return true;
|
||||
}
|
||||
|
||||
m_bProjectileMode = (GetProjectileData(g_pLocalPlayer->weapon, m_flProjSpeed, m_bProjArc));
|
||||
m_bProjectileMode = (GetProjectileData(g_pLocalPlayer->weapon, m_flProjSpeed, m_bProjArc, m_flProjGravity));
|
||||
// TODO priority modes (FOV, Smart, Distance, etc)
|
||||
if (!this->v_bPriority->GetBool()) {
|
||||
IClientEntity* target_locked = interfaces::entityList->GetClientEntity(target_lock);
|
||||
@ -199,7 +214,7 @@ bool HAimbot::ShouldTarget(IClientEntity* entity) {
|
||||
int local = interfaces::engineClient->GetLocalPlayer();
|
||||
IClientEntity* player = interfaces::entityList->GetClientEntity(local);
|
||||
char life_state = GetEntityValue<char>(entity, eoffsets.iLifeState);
|
||||
if (life_state) return false; // TODO magic number: life state
|
||||
if (life_state) return false;
|
||||
if (!player) return false;
|
||||
if (v_bRespectCloak->GetBool() && (GetEntityValue<int>(entity, eoffsets.iCond) & cond::cloaked)) return false;
|
||||
int health = GetEntityValue<int>(entity, eoffsets.iHealth);
|
||||
@ -223,7 +238,7 @@ bool HAimbot::ShouldTarget(IClientEntity* entity) {
|
||||
Vector resultAim;
|
||||
if (m_bProjectileMode) {
|
||||
resultAim = entity->GetAbsOrigin();
|
||||
if (!PredictProjectileAim(g_pLocalPlayer->v_Eye, entity, (hitbox)m_iHitbox, m_flProjSpeed, m_bProjArc, resultAim)) return false;
|
||||
if (!PredictProjectileAim(g_pLocalPlayer->v_Eye, entity, (hitbox)m_iHitbox, m_flProjSpeed, m_bProjArc, m_flProjGravity, resultAim)) return false;
|
||||
} else {
|
||||
if (v_bMachinaPenetration->GetBool()) {
|
||||
if (GetHitboxPosition(entity, m_iHitbox, resultAim)) return false;
|
||||
@ -236,6 +251,7 @@ bool HAimbot::ShouldTarget(IClientEntity* entity) {
|
||||
if (v_iFOV->GetBool() && (GetFov(g_pLocalPlayer->v_OrigViewangles, g_pLocalPlayer->v_Eye, resultAim) > v_iFOV->GetFloat())) return false;
|
||||
return true;
|
||||
} else if (IsBuilding(entity)) {
|
||||
if (!v_bAimBuildings->GetBool()) return false;
|
||||
int team = GetEntityValue<int>(entity, eoffsets.iTeamNum);
|
||||
if (team == g_pLocalPlayer->team) return false;
|
||||
Vector enemy_pos = entity->GetAbsOrigin();
|
||||
@ -245,7 +261,7 @@ bool HAimbot::ShouldTarget(IClientEntity* entity) {
|
||||
Vector resultAim;
|
||||
if (m_bProjectileMode) {
|
||||
resultAim = entity->GetAbsOrigin();
|
||||
if (!PredictProjectileAim(g_pLocalPlayer->v_Eye, entity, (hitbox)m_iHitbox, m_flProjSpeed, m_bProjArc, resultAim)) return false;
|
||||
if (!PredictProjectileAim(g_pLocalPlayer->v_Eye, entity, (hitbox)m_iHitbox, m_flProjSpeed, m_bProjArc, m_flProjGravity, resultAim)) return false;
|
||||
} else {
|
||||
//logging::Info("IsVisible?");
|
||||
if (!IsBuildingVisible(entity)) return false;
|
||||
@ -279,12 +295,10 @@ bool HAimbot::Aim(IClientEntity* entity, CUserCmd* cmd) {
|
||||
hit = GetBuildingPosition(entity);
|
||||
}
|
||||
if (v_bProjectileAimbot->GetBool()) {
|
||||
float speed = 0.0f;
|
||||
bool arc = false;
|
||||
if (GetProjectileData(g_pLocalPlayer->weapon, speed, arc)) {
|
||||
if (m_bProjectileMode) {
|
||||
if (v_iOverrideProjSpeed->GetBool())
|
||||
speed = v_iOverrideProjSpeed->GetFloat();
|
||||
PredictProjectileAim(g_pLocalPlayer->v_Eye, entity, (hitbox)m_iHitbox, speed, arc, hit);
|
||||
m_flProjSpeed = v_iOverrideProjSpeed->GetFloat();
|
||||
PredictProjectileAim(g_pLocalPlayer->v_Eye, entity, (hitbox)m_iHitbox, m_flProjSpeed, m_bProjArc, m_flProjGravity, hit);
|
||||
}
|
||||
}
|
||||
IClientEntity* local = interfaces::entityList->GetClientEntity(interfaces::engineClient->GetLocalPlayer());
|
||||
|
@ -19,9 +19,12 @@ public:
|
||||
HAimbot();
|
||||
bool ShouldTarget(IClientEntity* entity);
|
||||
bool Aim(IClientEntity* entity, CUserCmd* cmd);
|
||||
|
||||
bool m_bProjectileMode;
|
||||
float m_flProjSpeed;
|
||||
float m_flProjGravity;
|
||||
bool m_bProjArc;
|
||||
|
||||
int m_iLastTarget;
|
||||
int m_iHitbox;
|
||||
ConVar* v_iAimKey;
|
||||
@ -46,6 +49,9 @@ public:
|
||||
ConVar* v_bProjectileAimbot;
|
||||
ConVar* v_iOverrideProjSpeed;
|
||||
ConVar* v_bMachinaPenetration;
|
||||
ConVar* v_bAmbassador;
|
||||
ConVar* v_bAimBuildings;
|
||||
ConVar* v_bActiveOnlyWhenCanShoot;
|
||||
};
|
||||
|
||||
extern HAimbot* g_phAimbot;
|
||||
|
@ -233,8 +233,6 @@ void HEsp::ProcessEntity(CachedEntity* ent) {
|
||||
}
|
||||
bgclr = colors::GetTeamBgColor(ent->m_iTeam, !ent->m_bIsVisible);
|
||||
|
||||
// TODO TEMP
|
||||
//ent->AddESPString(color, "FOV %f", GetFov(g_pLocalPlayer->v_OrigViewangles, g_pLocalPlayer->v_Eye, ent->m_pEntity->GetAbsOrigin()));
|
||||
if (v_bLegit->GetBool() && ent->m_iTeam != g_pLocalPlayer->team && !GetRelation(ent->m_pEntity)) {
|
||||
if (pcond & cond::cloaked) return;
|
||||
if (ent->m_lLastSeen > (unsigned)v_iLegitSeenTicks->GetInt()) {
|
||||
|
@ -25,6 +25,7 @@ public:
|
||||
ConVar* v_bFinishingHit;
|
||||
ConVar* v_iMinRange;
|
||||
ConVar* v_bBuildings;
|
||||
ConVar* v_bIgnoreVaccinator;
|
||||
};
|
||||
|
||||
extern HTrigger* g_phTrigger;
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <iconvar.h>
|
||||
#include <dt_common.h>
|
||||
#include <inputsystem/iinputsystem.h>
|
||||
#include <globalvars_base.h>
|
||||
|
||||
const char* Misc::GetName() {
|
||||
return "MISC";
|
||||
@ -264,13 +265,16 @@ void Misc::PaintTraverse(void*, unsigned int, bool, bool) {
|
||||
if (g_pLocalPlayer->weapon) {
|
||||
IClientEntity* weapon = g_pLocalPlayer->weapon;
|
||||
AddSideString(draw::white, draw::black, "Weapon: %s [%i]", weapon->GetClientClass()->GetName(), weapon->GetClientClass()->m_ClassID);
|
||||
AddSideString(draw::white, draw::black, "flNextPrimaryAttack: %f", GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flNextPrimaryAttack) + 569);
|
||||
AddSideString(draw::white, draw::black, "nTickBase: %f", (float)(GetEntityValue<int>(g_pLocalPlayer->entity, eoffsets.nTickBase)) / 66);
|
||||
AddSideString(draw::white, draw::black, "CanShoot: %i", CanShoot(g_pLocalPlayer->entity));
|
||||
AddSideString(draw::white, draw::black, "flNextPrimaryAttack: %f", GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flNextPrimaryAttack));
|
||||
AddSideString(draw::white, draw::black, "nTickBase: %f", (float)(GetEntityValue<int>(g_pLocalPlayer->entity, eoffsets.nTickBase)) * interfaces::gvars->interval_per_tick);
|
||||
AddSideString(draw::white, draw::black, "CanShoot: %i", BulletTime());
|
||||
AddSideString(draw::white, draw::black, "Decaps: %i", GetEntityValue<int>(g_pLocalPlayer->entity, eoffsets.iDecapitations));
|
||||
AddSideString(draw::white, draw::black, "Damage: %f", GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flChargedDamage));
|
||||
AddSideString(draw::white, draw::black, "DefIndex: %i", GetEntityValue<int>(g_pLocalPlayer->weapon, eoffsets.iItemDefinitionIndex));
|
||||
|
||||
AddSideString(draw::white, draw::black, "GlobalVars: 0x%08x", interfaces::gvars);
|
||||
AddSideString(draw::white, draw::black, "realtime: %f", interfaces::gvars->realtime);
|
||||
AddSideString(draw::white, draw::black, "interval_per_tick: %f", interfaces::gvars->interval_per_tick);
|
||||
AddSideString(draw::white, draw::black, "ambassador_can_headshot: %i", (interfaces::gvars->curtime - GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flLastFireTime)) > 0.95);
|
||||
//AddSideString(draw::white, draw::black, "VecPunchAngle: %f %f %f", pa.x, pa.y, pa.z);
|
||||
//draw::DrawString(10, y, draw::white, draw::black, false, "VecPunchAngleVel: %f %f %f", pav.x, pav.y, pav.z);
|
||||
//y += 14;
|
||||
|
@ -411,36 +411,51 @@ float DistToSqr(IClientEntity* entity) {
|
||||
return g_pLocalPlayer->v_Origin.DistToSqr(entity->GetAbsOrigin());
|
||||
}
|
||||
|
||||
bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc) {
|
||||
bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc, float& gravity) {
|
||||
if (!weapon) return false;
|
||||
float rspeed;
|
||||
bool rarc;
|
||||
float rgrav = 0.5f;
|
||||
switch (weapon->GetClientClass()->m_ClassID) {
|
||||
case weapons::WP_DIRECT_HIT:
|
||||
rspeed = 1980;
|
||||
rspeed = 1980.0f;
|
||||
rarc = false;
|
||||
//rgrav = 0.0f;
|
||||
break;
|
||||
case weapons::WP_ROCKET_LAUNCHER:
|
||||
rspeed = 1100;
|
||||
rspeed = 1100.0f;
|
||||
rarc = false;
|
||||
//rgrav = 0.0f;
|
||||
break;
|
||||
case weapons::WP_GRENADE_LAUNCHER:
|
||||
rspeed = 1217.5f;
|
||||
rspeed = 1200.0f; // TODO Loch-N-Load: 1500u
|
||||
rarc = true;
|
||||
//rgrav = 0.5f;
|
||||
break;
|
||||
case weapons::WP_HUNTSMAN:
|
||||
rspeed = 2600.0f;
|
||||
case weapons::WP_HUNTSMAN: {
|
||||
// TODO curtime
|
||||
float begincharge = GetEntityValue<float>(weapon, eoffsets.flChargeBeginTime);
|
||||
float charge = 0;
|
||||
if (begincharge != 0) {
|
||||
charge = interfaces::gvars->curtime - begincharge;
|
||||
if (charge > 1.0f) charge = 1.0f;
|
||||
}
|
||||
rgrav = 0.5 - 0.4 * charge;
|
||||
rspeed = 1800 + 800 * charge;
|
||||
rarc = true;
|
||||
break;
|
||||
} break;
|
||||
case weapons::WP_SANDMAN:
|
||||
//rgrav = 1.0f;
|
||||
rspeed = 3000.0f;
|
||||
rarc = true;
|
||||
break;
|
||||
case weapons::WP_FLAREGUN:
|
||||
//rgrav = 1.0f;
|
||||
rspeed = 2000.0f;
|
||||
rarc = true;
|
||||
break;
|
||||
case ClassID::CTFSyringeGun:
|
||||
//rgrav = 1.0f;
|
||||
rspeed = 1000.0f;
|
||||
rarc = true;
|
||||
break;
|
||||
@ -449,6 +464,7 @@ bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc) {
|
||||
}
|
||||
speed = rspeed;
|
||||
arc = rarc;
|
||||
gravity = rgrav;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -470,7 +486,7 @@ bool IsVectorVisible(Vector origin, Vector target) {
|
||||
return (dist1 <= dist2);
|
||||
}
|
||||
|
||||
bool PredictProjectileAim(Vector origin, IClientEntity* target, hitbox hb, float speed, bool arc, Vector& result) {
|
||||
bool PredictProjectileAim(Vector origin, IClientEntity* target, hitbox hb, float speed, bool arc, float gravity, Vector& result) {
|
||||
if (!target) return false;
|
||||
//logging::Info("PRED PROJ AIM");
|
||||
//logging::Info("ProjSpeed: %f", speed);
|
||||
@ -490,7 +506,7 @@ bool PredictProjectileAim(Vector origin, IClientEntity* target, hitbox hb, float
|
||||
}
|
||||
res1 += GetEntityValue<Vector>(target, eoffsets.vVelocity) * time;
|
||||
if (arc)
|
||||
res1.z += (800 * 0.5 * 0.1 * time * time);
|
||||
res1.z += (800 * 0.5 * gravity * time * time);
|
||||
result = res1;
|
||||
//if (!IsVisible();
|
||||
return IsVectorVisible(origin, res1);
|
||||
@ -605,17 +621,10 @@ bool CanHeadshot(IClientEntity* player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BulletTime(IClientEntity* entity, bool use_int) {
|
||||
float interval = 1 / 66;
|
||||
float tickbase = (float)GetEntityValue<int>(entity, eoffsets.nTickBase) * interval;
|
||||
float nextattack = GetEntityValue<float>(entity, eoffsets.flNextPrimaryAttack) + 569;
|
||||
bool ctb = nextattack <= tickbase;
|
||||
return ctb;
|
||||
}
|
||||
|
||||
bool CanShoot(IClientEntity* player) {
|
||||
if (!player) return false;
|
||||
return BulletTime(g_pLocalPlayer->weapon, true);
|
||||
bool BulletTime() {
|
||||
float tickbase = (float)(GetEntityValue<int>(g_pLocalPlayer->entity, eoffsets.nTickBase)) * interfaces::gvars->interval_per_tick;
|
||||
float nextattack = GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flNextPrimaryAttack);
|
||||
return nextattack <= tickbase;
|
||||
}
|
||||
|
||||
// TODO casting
|
||||
|
@ -54,9 +54,9 @@ float DistToSqr(IClientEntity* entity);
|
||||
void fClampAngle(Vector& qaAng);
|
||||
void fVectorAngles(Vector &forward, Vector &angles);
|
||||
float deg2rad(float deg);
|
||||
bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc);
|
||||
bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc, float& gravity);
|
||||
bool IsVectorVisible(Vector a, Vector b);
|
||||
bool PredictProjectileAim(Vector origin, IClientEntity* target, hitbox hb, float speed, bool arc, Vector& result);
|
||||
bool PredictProjectileAim(Vector origin, IClientEntity* target, hitbox hb, float speed, bool arc, float gravity, Vector& result);
|
||||
relation GetRelation(IClientEntity* ent);
|
||||
bool IsSentryBuster(IClientEntity* ent);
|
||||
char* strfmt(const char* fmt, ...);
|
||||
@ -70,8 +70,7 @@ Vector QAngleToVector(QAngle in);
|
||||
bool CanHeadshot(IClientEntity* player);
|
||||
bool CheckCE(CachedEntity* entity);
|
||||
|
||||
bool BulletTime(IClientEntity* ent, bool interval);
|
||||
bool CanShoot(IClientEntity* entity);
|
||||
bool BulletTime();
|
||||
|
||||
bool IsEntityVisiblePenetration(IClientEntity* entity, int hb);
|
||||
|
||||
|
@ -15,6 +15,8 @@ unsigned int hooks::offCreateMove = 22;
|
||||
unsigned int hooks::offPaintTraverse = 42;
|
||||
unsigned int hooks::offOverrideView = 17;
|
||||
|
||||
// This thing had been copypasted from somewhere, maybe from F1Public.
|
||||
|
||||
unsigned int hooks::CountMethods(void** vmt) {
|
||||
unsigned int i = -1;
|
||||
do ++i; while (vmt[i]);
|
||||
@ -22,10 +24,6 @@ unsigned int hooks::CountMethods(void** vmt) {
|
||||
}
|
||||
|
||||
void**& hooks::GetVMT(void* inst, unsigned int offset) {
|
||||
// I'm not quite sure what happens here...
|
||||
// inst is the pointer to class
|
||||
// (char*) inst + offset is the pointer to vmt
|
||||
// so it casts vmt pointer to void*** and returns its value..?
|
||||
return *reinterpret_cast<void***>((char*)inst + offset);
|
||||
}
|
||||
|
||||
@ -62,6 +60,7 @@ void hooks::VMTHook::Apply() {
|
||||
*vmt = array + 3;
|
||||
}
|
||||
|
||||
// TODO rename these
|
||||
hooks::VMTHook* hooks::hkCreateMove = 0;
|
||||
hooks::VMTHook* hooks::hkPaintTraverse = 0;
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "interfaces.h"
|
||||
#include "sharedobj.h"
|
||||
#include "logging.h"
|
||||
#include "copypasted/CSignature.h"
|
||||
|
||||
#include <ISteamClient017.h>
|
||||
|
||||
@ -25,8 +26,8 @@ IBaseClientDLL* interfaces::baseClient = 0;
|
||||
IEngineTrace* interfaces::trace = 0;
|
||||
IVModelInfoClient* interfaces::model = 0;
|
||||
IInputSystem* interfaces::input = 0;
|
||||
//IClient* interfaces::client = 0;
|
||||
//ICvar* interfaces::cvar = 0;
|
||||
ICvar* interfaces::cvar = 0;
|
||||
CGlobalVarsBase* interfaces::gvars = 0;
|
||||
|
||||
void interfaces::CreateInterfaces() {
|
||||
interfaces::centerPrint = reinterpret_cast<ICenterPrint*>(sharedobj::client->fptr("VCENTERPRINT002", nullptr));
|
||||
@ -45,4 +46,8 @@ void interfaces::CreateInterfaces() {
|
||||
HSteamPipe sp = interfaces::steamClient->CreateSteamPipe();
|
||||
HSteamUser su = interfaces::steamClient->ConnectToGlobalUser(sp);
|
||||
interfaces::steamFriends = reinterpret_cast<ISteamFriends002*>(interfaces::steamClient->GetISteamFriends(su, sp, "SteamFriends002"));
|
||||
//uintptr_t hudupdate = (uintptr_t)hooks::GetVMT(interfaces::baseClient, 0)[11];
|
||||
//interfaces::gvars = *reinterpret_cast<CGlobalVarsBase**>(gSignatures.GetClientSignature("55 89 E5 53 83 EC ? A1 ? ? ? ? 0F B6 5D 0C F3 0F 10 40 10") + 8);
|
||||
interfaces::gvars = **(reinterpret_cast<CGlobalVarsBase***>((uintptr_t)11 + gSignatures.GetClientSignature("55 89 E5 83 EC ? 8B 45 08 8B 15 ? ? ? ? F3 0F 10")));
|
||||
//interfaces::gvars = *reinterpret_cast<CGlobalVarsBase**>(hudupdate + 13 + *reinterpret_cast<uint32_t*>(hudupdate + 13 + 3) + 7);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ class IEngineTrace;
|
||||
class IVModelInfoClient;
|
||||
class IInputSystem;
|
||||
class IClient;
|
||||
class CGlobalVarsBase;
|
||||
|
||||
namespace interfaces {
|
||||
|
||||
@ -42,7 +43,7 @@ extern IBaseClientDLL* baseClient;
|
||||
extern IEngineTrace* trace;
|
||||
extern IVModelInfoClient* model;
|
||||
extern IInputSystem* input;
|
||||
//extern IClient* client;
|
||||
extern CGlobalVarsBase* gvars;
|
||||
|
||||
void CreateInterfaces();
|
||||
|
||||
|
@ -12,13 +12,10 @@
|
||||
#include <string.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#include "interfaces.h"
|
||||
#include "fixsdk.h"
|
||||
#include <icvar.h>
|
||||
|
||||
namespace interfaces {
|
||||
ICvar* cvar;
|
||||
}
|
||||
|
||||
FILE* logging::handle = 0;
|
||||
|
||||
void logging::Initialize() {
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
#include <time.h>
|
||||
|
||||
// TODO this whole profiler thing could be done a lot better..
|
||||
|
||||
#define ENABLE_PROFILER false
|
||||
#define PROFILER_OUTPUT_DEPTH 1
|
||||
#define MAX_PROFILER_SECTIONS 16
|
||||
|
@ -74,14 +74,5 @@ void sharedobj::LoadAllSharedObjects() {
|
||||
sharedobj::vguimatsurface = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/vguimatsurface.so", user), true);
|
||||
sharedobj::vstdlib = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/libvstdlib.so", user), true);
|
||||
sharedobj::inputsystem = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/inputsystem.so", user), true);
|
||||
/*sharedobj::client = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/tf/bin/client.so", true);
|
||||
sharedobj::engine = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/engine.so", true);
|
||||
//sharedobj::steamclient = new SharedObject(STEAM_BASEDIR "linux32/steamclient.so", true);
|
||||
sharedobj::steamclient = new SharedObject("/home/steam-0/.local/share/Steam/linux32/steamclient.so", true);
|
||||
sharedobj::tier0 = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/libtier0.so", false);
|
||||
sharedobj::vgui2 = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/vgui2.so", true);
|
||||
sharedobj::vguimatsurface = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/vguimatsurface.so", true);
|
||||
sharedobj::vstdlib = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/libvstdlib.so", true);
|
||||
sharedobj::inputsystem = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/inputsystem.so", true);*/
|
||||
}
|
||||
|
||||
|
@ -92,6 +92,6 @@ int GetScoreForEntity(IClientEntity* entity) {
|
||||
if (total > 99) total = 99;
|
||||
if (GetRelation(entity) == relation::RAGE) total = 999;
|
||||
if (IsSentryBuster(entity)) total = 0;
|
||||
if (clazz == tf_medic) total = 999; // TODO mvm
|
||||
//if (clazz == tf_medic) total = 999; // TODO only for mvm
|
||||
return total;
|
||||
}
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include <client_class.h>
|
||||
#include <icliententity.h>
|
||||
|
||||
// This file is a mess. I need to fix it. TODO
|
||||
|
||||
/* Default Filter */
|
||||
|
||||
trace::FilterDefault::FilterDefault() {
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include "fixsdk.h"
|
||||
#include <engine/IEngineTrace.h>
|
||||
|
||||
// This file is a mess. I need to fix it. TODO
|
||||
|
||||
class IClientEntity;
|
||||
|
||||
namespace trace {
|
||||
|
@ -12,10 +12,14 @@
|
||||
#include "fixsdk.h"
|
||||
#include <icliententity.h>
|
||||
|
||||
int g_MeleeList[] = {
|
||||
bool IsAmbassador(IClientEntity* weapon) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*int g_MeleeList[] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 37,
|
||||
};
|
||||
|
||||
bool IsMeleeWeapon(int defidx) {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
@ -8,6 +8,10 @@
|
||||
#ifndef WEAPONPREFS_H_
|
||||
#define WEAPONPREFS_H_
|
||||
|
||||
class IClientEntity;
|
||||
|
||||
bool IsAmbassador(IClientEntity* entity);
|
||||
|
||||
/*extern int g_MeleeList[];
|
||||
|
||||
bool IsMeleeWeapon(int defidx);
|
||||
|
Reference in New Issue
Block a user