From ab3d725cacbe8cd7153c02faf2d9fe6df7e37949 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 17:02:45 +0100 Subject: Aimbot v2: bone checklist and numeric smoothness - Aimbot -> Bones: Head, Torso (chest+stomach), Left/Right arm, Left/Right leg; the aimbot aims at the nearest selected hitbox point on the chosen target (head uses the head hitbox/bone fallback) - Aimbot -> Smoothness: value 1..45 deg/tick, Left/Right in the menu to adjust, persisted as smooth=N; default 5 (previous behaviour) - config: bone_* toggles + smooth under [aimbot] - menu gains a NODE_VALUE type (right-aligned value, Left/Right edit) --- src/esp.cpp | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'src/esp.cpp') diff --git a/src/esp.cpp b/src/esp.cpp index 2987508..fbeb234 100644 --- a/src/esp.cpp +++ b/src/esp.cpp @@ -337,6 +337,9 @@ static QAngle angle_to(const Vector &from, const Vector &to) { bool aimbot_apply(CUserCmd *cmd) { if (!g_iface.entitylist || g_net.origin < 0 || g_net.maxs < 0) return false; + unsigned bone_mask = aimbot_bone_mask(); + if (!bone_mask) + return false; int local = engine_get_local_player(); if (local <= 0) return false; @@ -388,7 +391,8 @@ bool aimbot_apply(CUserCmd *cmd) { Vector origin{*(float *)(e + g_net.origin), *(float *)(e + g_net.origin + 4), *(float *)(e + g_net.origin + 8)}; - Vector approx{origin.x, origin.y, origin.z + maxz * 0.9f}; + Vector approx{origin.x, origin.y, + origin.z + maxz * ((bone_mask & (1u << 1)) ? 0.9f : 0.55f)}; float fov = getfov(view, angle_to(g_cam_eye, approx)); if (fov >= best_fov) continue; @@ -416,24 +420,33 @@ bool aimbot_apply(CUserCmd *cmd) { best_head.x, best_head.y, best_head.z); } - // Refine to the actual head hitbox/bone for the chosen target only. - bool exact_head = false; + // Refine to the nearest selected hitbox/bone point on the chosen target. + Vector pts[32]; + int npoints = 0; void *best_ent = entitylist_get(best_idx); - if (best_ent && bones_update(best_idx, best_ent)) { - Vector head; - if (head_position(best_idx, head) && - getfov(view, angle_to(g_cam_eye, head)) <= MAX_FOV) { - best_head = head; - exact_head = true; + if (best_ent && bones_update(best_idx, best_ent)) + npoints = aim_points(best_idx, bone_mask, pts, 32); + if (npoints <= 0) + return false; + float aim_fov = 1e9f; + Vector aim_pt{}; + for (int i = 0; i < npoints; i++) { + float f = getfov(view, angle_to(g_cam_eye, pts[i])); + if (f < aim_fov) { + aim_fov = f; + aim_pt = pts[i]; } } + if (aim_fov > MAX_FOV) + return false; + best_head = aim_pt; QAngle desired = angle_to(g_cam_eye, best_head); static int want_logs = 0; if (want_logs < 10) { want_logs++; - logf("aimbot: head=(%.1f %.1f %.1f) exact=%d want=%.2f/%.2f", - best_head.x, best_head.y, best_head.z, (int)exact_head, desired.x, + logf("aimbot: aim=(%.1f %.1f %.1f) points=%d fov=%.2f want=%.2f/%.2f", + best_head.x, best_head.y, best_head.z, npoints, aim_fov, desired.x, desired.y); } float dp = desired.x - cmd->viewangles[0]; @@ -442,12 +455,13 @@ bool aimbot_apply(CUserCmd *cmd) { while (dy < -180.0f) dy += 360.0f; constexpr float DEADZONE = 0.05f; - constexpr float MAX_STEP = 5.0f; + float max_step = (float)aimbot_smooth_step(); + if (max_step < 1.0f) max_step = 1.0f; float maxd = fmaxf(fabsf(dp), fabsf(dy)); if (maxd <= DEADZONE) return false; - float scale = (maxd > MAX_STEP) ? (MAX_STEP / maxd) : 1.0f; + float scale = (maxd > max_step) ? (max_step / maxd) : 1.0f; float old_pitch = cmd->viewangles[0]; float old_yaw = cmd->viewangles[1]; float np = cmd->viewangles[0] + dp * scale; -- cgit v1.2.3