diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-26 17:02:45 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-26 17:02:45 +0100 |
| commit | ab3d725cacbe8cd7153c02faf2d9fe6df7e37949 (patch) | |
| tree | 2bc17507d9fb0b6f37e2a6e62f1c210d16756c66 /src/bones.cpp | |
| parent | Aimbot: fix eye height (m_vecViewOffset Z, not X); prefer head hitbox (diff) | |
| download | hl2h-ab3d725cacbe8cd7153c02faf2d9fe6df7e37949.tar.gz hl2h-ab3d725cacbe8cd7153c02faf2d9fe6df7e37949.zip | |
Aimbot v2: bone checklist and numeric smoothness
- Aimbot -> Bones: Head, Torso (chest+stomach), Left/Right arm,
Left/Right leg; the aimbot aims at the nearest selected hitbox point on
the chosen target (head uses the head hitbox/bone fallback)
- Aimbot -> Smoothness: value 1..45 deg/tick, Left/Right in the menu to
adjust, persisted as smooth=N; default 5 (previous behaviour)
- config: bone_* toggles + smooth under [aimbot]
- menu gains a NODE_VALUE type (right-aligned value, Left/Right edit)
Diffstat (limited to '')
| -rw-r--r-- | src/bones.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/bones.cpp b/src/bones.cpp index abcaac6..12c7406 100644 --- a/src/bones.cpp +++ b/src/bones.cpp | |||
| @@ -460,3 +460,35 @@ bool head_position(int idx, Vector &out) { | |||
| 460 | } | 460 | } |
| 461 | return false; | 461 | return false; |
| 462 | } | 462 | } |
| 463 | |||
| 464 | // Collect world-space aim points for the selected hit groups (HITGROUP_*). | ||
| 465 | // Group 1 (head) uses head_position for its bone fallback; other groups are | ||
| 466 | // the hitbox centers. The caller picks the point nearest to the crosshair. | ||
| 467 | int aim_points(int idx, unsigned group_mask, Vector *out, int max) { | ||
| 468 | if (!out || max <= 0) | ||
| 469 | return 0; | ||
| 470 | BoneEntry *e = find_entry(idx); | ||
| 471 | if (!e || !e->valid || !e->hdr) | ||
| 472 | return 0; | ||
| 473 | int n = 0; | ||
| 474 | if ((group_mask & (1u << 1)) && n < max) { | ||
| 475 | Vector head; | ||
| 476 | if (head_position(idx, head)) | ||
| 477 | out[n++] = head; | ||
| 478 | } | ||
| 479 | const HitboxSet *s = hitbox_set0(e->hdr); | ||
| 480 | if (!s) | ||
| 481 | return n; | ||
| 482 | const Hitbox *boxes = hitboxes(s); | ||
| 483 | for (int i = 0; i < s->numhitboxes && n < max; i++) { | ||
| 484 | int g = boxes[i].group; | ||
| 485 | if (g <= 1 || g > 7) | ||
| 486 | continue; | ||
| 487 | if (!(group_mask & (1u << g))) | ||
| 488 | continue; | ||
| 489 | Vector p; | ||
| 490 | if (hitbox_world(e, boxes[i], p)) | ||
| 491 | out[n++] = p; | ||
| 492 | } | ||
| 493 | return n; | ||
| 494 | } | ||
