From ccec960a0d53a740eb546a9523811e066a5f118a Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 16:46:37 +0100 Subject: 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 --- src/hl2h.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/hl2h.cpp') diff --git a/src/hl2h.cpp b/src/hl2h.cpp index de5d194..c3b94fe 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp @@ -200,8 +200,10 @@ static void do_move(int seq) { return; uintptr_t e = (uintptr_t)ent; - g_cam_eye = {*(float *)(e + g_net.origin), *(float *)(e + g_net.origin + 4), *(float *)(e + g_net.origin + 8)}; - g_cam_eye.z += *(float *)(e + g_net.viewoffset); + const float *vo = (const float *)(e + g_net.viewoffset); + g_cam_eye = {*(float *)(e + g_net.origin) + vo[0], + *(float *)(e + g_net.origin + 4) + vo[1], + *(float *)(e + g_net.origin + 8) + vo[2]}; g_cam_view = {cmd->viewangles[0], cmd->viewangles[1], cmd->viewangles[2]}; int flags = *(int *)(e + g_net.flags); bool onground = (flags & FL_ONGROUND) != 0; -- cgit v1.2.3