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/bones.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/bones.cpp') diff --git a/src/bones.cpp b/src/bones.cpp index f33a4b2..abcaac6 100644 --- a/src/bones.cpp +++ b/src/bones.cpp @@ -439,6 +439,12 @@ bool head_position(int idx, Vector &out) { const HitboxSet *s = hitbox_set0(e->hdr); if (s) { const Hitbox *boxes = hitboxes(s); + // HITGROUP_HEAD == 1. HL2 models often have no hitbox names, so use the + // damage-group head hitbox first (zombie: headcrab body, humanoids: head). + for (int i = 0; i < s->numhitboxes; i++) { + if (boxes[i].group == 1 && hitbox_world(e, boxes[i], out)) + return true; + } for (int i = 0; i < s->numhitboxes; i++) { if (boxes[i].bone < 0 || boxes[i].bone >= e->count) continue; -- cgit v1.2.3