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/bones.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/bones.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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) { | |||
| 439 | const HitboxSet *s = hitbox_set0(e->hdr); | 439 | const HitboxSet *s = hitbox_set0(e->hdr); |
| 440 | if (s) { | 440 | if (s) { |
| 441 | const Hitbox *boxes = hitboxes(s); | 441 | const Hitbox *boxes = hitboxes(s); |
| 442 | // HITGROUP_HEAD == 1. HL2 models often have no hitbox names, so use the | ||
| 443 | // damage-group head hitbox first (zombie: headcrab body, humanoids: head). | ||
| 444 | for (int i = 0; i < s->numhitboxes; i++) { | ||
| 445 | if (boxes[i].group == 1 && hitbox_world(e, boxes[i], out)) | ||
| 446 | return true; | ||
| 447 | } | ||
| 442 | for (int i = 0; i < s->numhitboxes; i++) { | 448 | for (int i = 0; i < s->numhitboxes; i++) { |
| 443 | if (boxes[i].bone < 0 || boxes[i].bone >= e->count) | 449 | if (boxes[i].bone < 0 || boxes[i].bone >= e->count) |
| 444 | continue; | 450 | continue; |
