From 6618d19660c42f4a6ae48cdaec23324e6e79def1 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 12:50:11 +0100 Subject: 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. --- src/hl2h.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/hl2h.cpp') 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) { } if (feature_active(FEAT_TRIGGERBOT)) { - if (triggerbot_apply(cmd)) + if (triggerbot_apply(cmd)) { + // Triggerbot sets IN_ATTACK after CInput's spread hook, so the best + // seed has to be applied here as well. + spread_control_apply(cmd, ent); note_modified(cmd, flags, vel); + } } if (feature_active(FEAT_SILENTAIM)) { - if (silent_aim_apply(cmd)) + if (silent_aim_apply(cmd)) { + // Silent aim also sets IN_ATTACK late; without this the shot keeps + // the random CInput seed instead of the minimal-spread seed. + spread_control_apply(cmd, ent); note_modified(cmd, flags, vel); + } } } } -- cgit v1.2.3