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. --- CONTEXT.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 0ecf80c..a9e34d8 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -176,7 +176,10 @@ vocabulary / decisions. - Silent aim: exact target angle written to `cmd->viewangles`, `IN_ATTACK`, then the rendered view is restored immediately **and** at `FRAME_RENDER_START`; `forwardmove`/`sidemove` are rewritten to preserve the - world-space movement wish vector. + world-space movement wish vector. Because `IN_ATTACK` is set after + `CInput::CreateMove`, the minimal-spread seed is applied again in `do_move` + (same for triggerbot). Crossbow bolts and RPG rockets are led by target + velocity and travel time; the crossbow also gets its 0.05 gravity drop. - ABH: on the landing/jump tick, face opposite the horizontal velocity with zero forward/side movement; HL2's jump speed-bound subtraction then accelerates along the velocity. Camera restored at `FRAME_RENDER_START`. @@ -212,6 +215,8 @@ vocabulary / decisions. `RandomSeed`/`RandomFloat`, the 8-bit seed whose `CShotManipulator::ApplySpread` offset is smallest. It sets `cmd->random_seed` on attack commands; `note_modified` repairs the CRC. + Silent aim and triggerbot set `IN_ATTACK` after the CInput hook, so they + re-apply the best seed in `do_move`. - Shotguns use consecutive seeds per pellet. The primary's first pellet is `FIRE_BULLETS_FIRST_SHOT_ACCURATE`, so the table excludes it; the secondary uses all 12. Separate best starting seeds are precomputed for 1, 8 and 12 -- cgit v1.2.3