From ed9c32c2a4784c327c46568d0de38c161c98957e Mon Sep 17 00:00:00 2001 From: bencat07 Date: Wed, 3 Oct 2018 11:14:08 +0200 Subject: [PATCH] improvements --- src/hacks/AntiCheat.cpp | 13 +++++++-- src/hacks/MiscAimbot.cpp | 63 +++++++++++++++++++++------------------- src/hacks/NavBot.cpp | 11 +++++-- 3 files changed, 52 insertions(+), 35 deletions(-) diff --git a/src/hacks/AntiCheat.cpp b/src/hacks/AntiCheat.cpp index 10607bb3..e1738922 100644 --- a/src/hacks/AntiCheat.cpp +++ b/src/hacks/AntiCheat.cpp @@ -10,6 +10,7 @@ #include #include #include "common.hpp" +#include "PlayerTools.hpp" #include "hack.hpp" static settings::Bool enable{ "find-cheaters.enable", "0" }; @@ -66,9 +67,15 @@ void CreateMove() { if ((CE_BYTE(ent, netvar.iLifeState) == 0)) { - ac::aimbot::Update(ent); - ac::antiaim::Update(ent); - ac::bhop::Update(ent); + if (player_tools::shouldTarget(ent) == + player_tools::IgnoreReason::DO_NOT_IGNORE || + player_tools::shouldTarget(ent) == + player_tools::IgnoreReason::LOCAL_PLAYER_LIST) + { + ac::aimbot::Update(ent); + ac::antiaim::Update(ent); + ac::bhop::Update(ent); + } } } } diff --git a/src/hacks/MiscAimbot.cpp b/src/hacks/MiscAimbot.cpp index bf29559f..83beaf64 100644 --- a/src/hacks/MiscAimbot.cpp +++ b/src/hacks/MiscAimbot.cpp @@ -12,7 +12,8 @@ static settings::Int aimkey_mode{ "sandwichaim.aimkey-mode", "0" }; float sandwich_speed = 350.0f; float grav = 0.25f; -std::pair FindBestEnt(bool teammate, bool Predict, bool zcheck) +std::pair FindBestEnt(bool teammate, bool Predict, + bool zcheck) { CachedEntity *bestent = nullptr; float bestscr = FLT_MAX; @@ -21,7 +22,8 @@ std::pair FindBestEnt(bool teammate, bool Predict, bool { CachedEntity *ent = ENTITY(i); if (CE_BAD(ent) || !(ent->m_bAlivePlayer()) || - (teammate && ent->m_iTeam() != LOCAL_E->m_iTeam()) || ent == LOCAL_E) + (teammate && ent->m_iTeam() != LOCAL_E->m_iTeam()) || + ent == LOCAL_E) continue; if (!teammate && ent->m_iTeam() == LOCAL_E->m_iTeam()) continue; @@ -30,7 +32,7 @@ std::pair FindBestEnt(bool teammate, bool Predict, bool Vector target{}; if (Predict) target = ProjectilePrediction(ent, 1, sandwich_speed, grav, - PlayerGravityMod(ent)); + PlayerGravityMod(ent)); else target = ent->hitboxes.GetHitbox(1)->center; if (!IsEntityVectorVisible(ent, target)) @@ -42,12 +44,12 @@ std::pair FindBestEnt(bool teammate, bool Predict, bool scr *= 0.1f; if (scr < bestscr) { - bestent = ent; + bestent = ent; predicted = target; - bestscr = scr; + bestscr = scr; } } - return {bestent, predicted}; + return { bestent, predicted }; } static HookedFunction SandwichAim(HookedFunctions_types::HF_CreateMove, "SandwichAim", 1, []() { @@ -76,7 +78,7 @@ static HookedFunction Vector Predict; CachedEntity *bestent = nullptr; std::pair result{}; - result = FindBestEnt(true, true, false); + result = FindBestEnt(true, true, false); bestent = result.first; Predict = result.second; if (bestent) @@ -91,26 +93,27 @@ static HookedFunction g_pLocalPlayer->bUseSilentAngles = true; } }); -static settings::Bool charge_aim{ "chargeaim.enable", "false"}; -static HookedFunction ChargeAimbot(HookedFunctions_types::HF_CreateMove, "ChargeAim", 1, [](){ - if (!*charge_aim) - return; - if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer()) - return; - if (!HasCondition(LOCAL_E)) - return; - std::pair result{}; - result = FindBestEnt(false, false, true); - CachedEntity *bestent = result.first; - if (bestent && result.second.IsValid()) - { - Vector tr = result.second - g_pLocalPlayer->v_Eye; - Vector angles; - VectorAngles(tr, angles); - // Clamping is important - fClampAngle(angles); - current_user_cmd->viewangles = angles; - current_user_cmd->buttons |= IN_ATTACK2; - g_pLocalPlayer->bUseSilentAngles = true; - } -}); \ No newline at end of file +static settings::Bool charge_aim{ "chargeaim.enable", "false" }; +static HookedFunction + ChargeAimbot(HookedFunctions_types::HF_CreateMove, "ChargeAim", 1, []() { + if (!*charge_aim) + return; + if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer()) + return; + if (!HasCondition(LOCAL_E)) + return; + std::pair result{}; + result = FindBestEnt(false, false, true); + CachedEntity *bestent = result.first; + if (bestent && result.second.IsValid()) + { + Vector tr = result.second - g_pLocalPlayer->v_Eye; + Vector angles; + VectorAngles(tr, angles); + // Clamping is important + fClampAngle(angles); + current_user_cmd->viewangles = angles; + current_user_cmd->buttons |= IN_ATTACK2; + g_pLocalPlayer->bUseSilentAngles = true; + } + }); \ No newline at end of file diff --git a/src/hacks/NavBot.cpp b/src/hacks/NavBot.cpp index bbab58d5..4533fdab 100644 --- a/src/hacks/NavBot.cpp +++ b/src/hacks/NavBot.cpp @@ -361,8 +361,15 @@ bool NavToEnemy() { int nearestvalid{}; if (!*heavy_mode) - nearestvalid = - nav::FindNearestValidbyDist(ent->m_vecOrigin(), 1000, 4000); + { + int range = 0; + while (nearestvalid == -1 && range < 5000) + { + nearestvalid = + nav::FindNearestValidbyDist(ent->m_vecOrigin(), 2000 - range/4 , 6000 - range); + range += 300.0f; + } + } else nearestvalid = nav::FindNearestValidbyDist(ent->m_vecOrigin(), 200, 1000);