From 553bb50141a323ba0d5b72cad7a0d6e4c877a77b Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 28 Apr 2019 14:39:08 +0200 Subject: [PATCH] Decrease autobackstab melee range instead of shrinking hitbox --- src/hacks/AutoBackstab.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/hacks/AutoBackstab.cpp b/src/hacks/AutoBackstab.cpp index 51a9a404..07ecf248 100644 --- a/src/hacks/AutoBackstab.cpp +++ b/src/hacks/AutoBackstab.cpp @@ -118,6 +118,7 @@ static void doBacktrackStab() continue; Vector distcheck = btp.entorigin; distcheck.z = g_pLocalPlayer->v_Eye.z; + // dont stab while inside the enemy if (distcheck.DistTo(g_pLocalPlayer->v_Eye) < 20.0f) continue; // Get and calculate an angle to use to backstab the ent @@ -126,13 +127,9 @@ static void doBacktrackStab() continue; Vector &min = btp.collidable.min; Vector &max = btp.collidable.max; - // Shrink by 5% - min.x += (max.x - min.x) / 100.0f * 5.0f; - max.x -= (max.x - min.x) / 100.0f * 5.0f; - min.y += (max.y - min.y) / 100.0f * 5.0f; - max.y -= (max.y - min.y) / 100.0f * 5.0f; Vector hit; - if (hacks::shared::triggerbot::CheckLineBox(min, max, g_pLocalPlayer->v_Eye, GetForwardVector(g_pLocalPlayer->v_Eye, newangle, swingrange), hit)) + // Check if we can hit the enemies hitbox + if (hacks::shared::triggerbot::CheckLineBox(min, max, g_pLocalPlayer->v_Eye, GetForwardVector(g_pLocalPlayer->v_Eye, newangle, swingrange * 0.95f), hit)) { current_user_cmd->tick_count = btp.tickcount; current_user_cmd->viewangles = newangle;