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/hl2h.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 'src/hl2h.cpp')
| -rw-r--r-- | src/hl2h.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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) { | |||
| 200 | return; | 200 | return; |
| 201 | 201 | ||
| 202 | uintptr_t e = (uintptr_t)ent; | 202 | uintptr_t e = (uintptr_t)ent; |
| 203 | g_cam_eye = {*(float *)(e + g_net.origin), *(float *)(e + g_net.origin + 4), *(float *)(e + g_net.origin + 8)}; | 203 | const float *vo = (const float *)(e + g_net.viewoffset); |
| 204 | g_cam_eye.z += *(float *)(e + g_net.viewoffset); | 204 | g_cam_eye = {*(float *)(e + g_net.origin) + vo[0], |
| 205 | *(float *)(e + g_net.origin + 4) + vo[1], | ||
| 206 | *(float *)(e + g_net.origin + 8) + vo[2]}; | ||
| 205 | g_cam_view = {cmd->viewangles[0], cmd->viewangles[1], cmd->viewangles[2]}; | 207 | g_cam_view = {cmd->viewangles[0], cmd->viewangles[1], cmd->viewangles[2]}; |
| 206 | int flags = *(int *)(e + g_net.flags); | 208 | int flags = *(int *)(e + g_net.flags); |
| 207 | bool onground = (flags & FL_ONGROUND) != 0; | 209 | bool onground = (flags & FL_ONGROUND) != 0; |
