summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 13:38:57 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 13:38:57 +0100
commite56d5ae8a472bde580de5704f59bbc0f74a6824f (patch)
tree41569c24cf3f98eca711646d896d25c064ec2911 /CONTEXT.md
parentNo spread: zero pellet offsets inside FireBullets (diff)
downloadhl2h-e56d5ae8a472bde580de5704f59bbc0f74a6824f.tar.gz
hl2h-e56d5ae8a472bde580de5704f59bbc0f74a6824f.zip
No spread: detect pellet draws from the FireBullets seed call
The ApplySpread random draws are not guaranteed to run in the player's frame (the compiler can outline them), so the frame-based shooter check missed and the shotgun kept its seed-minimised spread. The player's FireBullets RandomSeed call now arms a short 8-draw window; the next RandomFloat draws return 0. Keep the frame check as the other path. Remove the diagnostics used to find this.
Diffstat (limited to '')
-rw-r--r--CONTEXT.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index 75b2f0a..98eb7d0 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -303,9 +303,13 @@ vocabulary / decisions.
303 ApplySpread` is inlined into `CBaseEntity::FireBullets` and draws x/y via 303 ApplySpread` is inlined into `CBaseEntity::FireBullets` and draws x/y via
304 the global `CUniformRandomStream` (`_ZTV20CUniformRandomStream` + 8, slot 1 304 the global `CUniformRandomStream` (`_ZTV20CUniformRandomStream` + 8, slot 1
305 = `RandomFloat(float,float)`; confirmed against `libvstdlib.so`). The hook 305 = `RandomFloat(float,float)`; confirmed against `libvstdlib.so`). The hook
306 returns 0 for those draws only when the calling frame's `this` (at 306 returns 0 for those draws so every pellet follows the exact shot direction.
307 `ebp+8`) is the local server player, so every pellet follows the exact shot 307 Detection is frame-based (`ebp+8` = the local server player) *and* a small
308 direction. NPC fire and the client's prediction stream keep normal values. 308 armed window: the player's `FireBullets` `RandomSeed` call sets a counter of
309 8 draws, which the next `RandomFloat` calls consume. The window is required
310 because the compiler can outline the `ApplySpread` draws into a different
311 frame, where the first argument is not the player. NPC fire and the client's
312 prediction stream keep normal values.
309- This attacks the random cone offset only. The cone size, the pistol's 313- This attacks the random cone offset only. The cone size, the pistol's
310 `m_flAccuracyPenalty` growth, the server view punch added to 314 `m_flAccuracyPenalty` growth, the server view punch added to
311 `GetAutoaimVector`, and any damage falloff are server-side state. In 315 `GetAutoaimVector`, and any damage falloff are server-side state. In