diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-28 12:50:11 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-28 12:50:11 +0100 |
| commit | 6618d19660c42f4a6ae48cdaec23324e6e79def1 (patch) | |
| tree | c4fb9f08c96f86c455a600e6862e43e53d0be6f1 /src/hl2h.cpp | |
| parent | Item ESP: make 0 = unlimited explicit and persistent (diff) | |
| download | hl2h-6618d19660c42f4a6ae48cdaec23324e6e79def1.tar.gz hl2h-6618d19660c42f4a6ae48cdaec23324e6e79def1.zip | |
Combat: fix silent-aim spread seed and lead projectiles
- Silent aim and triggerbot set IN_ATTACK after CInput::CreateMove, so the
minimal-spread seed was never applied to their shots. Re-apply
spread_control_apply after setting the attack button, then update the CRC.
- Crossbow bolts and RPG rockets are not hitscan. Lead the selected hitbox by
target velocity * travel time; the crossbow bolt also gets its 0.05 gravity
drop (30 u/s^2). Apply the same correction to the smooth aimbot.
- Document both paths in CONTEXT.
Diffstat (limited to 'src/hl2h.cpp')
| -rw-r--r-- | src/hl2h.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/hl2h.cpp b/src/hl2h.cpp index 256b9ab..4f5673f 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp | |||
| @@ -689,13 +689,21 @@ static void do_move(int seq, float frametime) { | |||
| 689 | } | 689 | } |
| 690 | 690 | ||
| 691 | if (feature_active(FEAT_TRIGGERBOT)) { | 691 | if (feature_active(FEAT_TRIGGERBOT)) { |
| 692 | if (triggerbot_apply(cmd)) | 692 | if (triggerbot_apply(cmd)) { |
| 693 | // Triggerbot sets IN_ATTACK after CInput's spread hook, so the best | ||
| 694 | // seed has to be applied here as well. | ||
| 695 | spread_control_apply(cmd, ent); | ||
| 693 | note_modified(cmd, flags, vel); | 696 | note_modified(cmd, flags, vel); |
| 697 | } | ||
| 694 | } | 698 | } |
| 695 | 699 | ||
| 696 | if (feature_active(FEAT_SILENTAIM)) { | 700 | if (feature_active(FEAT_SILENTAIM)) { |
| 697 | if (silent_aim_apply(cmd)) | 701 | if (silent_aim_apply(cmd)) { |
| 702 | // Silent aim also sets IN_ATTACK late; without this the shot keeps | ||
| 703 | // the random CInput seed instead of the minimal-spread seed. | ||
| 704 | spread_control_apply(cmd, ent); | ||
| 698 | note_modified(cmd, flags, vel); | 705 | note_modified(cmd, flags, vel); |
| 706 | } | ||
| 699 | } | 707 | } |
| 700 | } | 708 | } |
| 701 | } | 709 | } |
