diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-26 16:46:37 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-26 16:46:37 +0100 |
| commit | ccec960a0d53a740eb546a9523811e066a5f118a (patch) | |
| tree | 5df27448116c31ab9afee0c2270d44963ff82163 /src/esp.cpp | |
| parent | Aimbot: push smoothed angles to engine view + diagnostics (diff) | |
| download | hl2h-ccec960a0d53a740eb546a9523811e066a5f118a.tar.gz hl2h-ccec960a0d53a740eb546a9523811e066a5f118a.zip | |
Aimbot: fix eye height (m_vecViewOffset Z, not X); prefer head hitbox
- g_cam_eye was adding the X component of m_vecViewOffset to Z, leaving the
eye ~64 units too low; the aimbot consequently aimed above heads
- head_position now prefers the HITGROUP_HEAD hitbox center before falling
back to bone names (zombie: headcrab body hitbox)
- log the exact head and desired angles for the first few aim ticks
Diffstat (limited to '')
| -rw-r--r-- | src/esp.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/esp.cpp b/src/esp.cpp index bd3fbdb..2987508 100644 --- a/src/esp.cpp +++ b/src/esp.cpp | |||
| @@ -417,15 +417,25 @@ bool aimbot_apply(CUserCmd *cmd) { | |||
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | // Refine to the actual head hitbox/bone for the chosen target only. | 419 | // Refine to the actual head hitbox/bone for the chosen target only. |
| 420 | bool exact_head = false; | ||
| 420 | void *best_ent = entitylist_get(best_idx); | 421 | void *best_ent = entitylist_get(best_idx); |
| 421 | if (best_ent && bones_update(best_idx, best_ent)) { | 422 | if (best_ent && bones_update(best_idx, best_ent)) { |
| 422 | Vector head; | 423 | Vector head; |
| 423 | if (head_position(best_idx, head) && | 424 | if (head_position(best_idx, head) && |
| 424 | getfov(view, angle_to(g_cam_eye, head)) <= MAX_FOV) | 425 | getfov(view, angle_to(g_cam_eye, head)) <= MAX_FOV) { |
| 425 | best_head = head; | 426 | best_head = head; |
| 427 | exact_head = true; | ||
| 428 | } | ||
| 426 | } | 429 | } |
| 427 | 430 | ||
| 428 | QAngle desired = angle_to(g_cam_eye, best_head); | 431 | QAngle desired = angle_to(g_cam_eye, best_head); |
| 432 | static int want_logs = 0; | ||
| 433 | if (want_logs < 10) { | ||
| 434 | want_logs++; | ||
| 435 | logf("aimbot: head=(%.1f %.1f %.1f) exact=%d want=%.2f/%.2f", | ||
| 436 | best_head.x, best_head.y, best_head.z, (int)exact_head, desired.x, | ||
| 437 | desired.y); | ||
| 438 | } | ||
| 429 | float dp = desired.x - cmd->viewangles[0]; | 439 | float dp = desired.x - cmd->viewangles[0]; |
| 430 | float dy = desired.y - cmd->viewangles[1]; | 440 | float dy = desired.y - cmd->viewangles[1]; |
| 431 | while (dy > 180.0f) dy -= 360.0f; | 441 | while (dy > 180.0f) dy -= 360.0f; |
