From d22bd8d184091e6a4600beb78eb279c2f5fab51b Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 13:26:33 +0100 Subject: No spread: zero pellet offsets inside FireBullets Picking the best of 256 pending seeds still leaves the shotgun's 8/12 pellets a few degrees apart. CShotManipulator::ApplySpread is inlined into CBaseEntity::FireBullets and draws x/y through the global CUniformRandomStream; hook its RandomFloat slot and return 0 when the calling frame's shooter is the local server player. This collapses every pellet onto the shot direction while NPC fire and client prediction keep their randomness. --- CONTEXT.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index bd3507a..75b2f0a 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -298,6 +298,14 @@ vocabulary / decisions. `CBaseEntity::FireBullets`; the `CUniformRandomStream` wrappers and constructor-time `RandomSeed(0)` resets pass other objects and are left alone. +- Seed choice alone cannot remove all of a shotgun's pellet spread: the best + of 256 sequences still leaves its 8/12 draws apart. `CShotManipulator:: + ApplySpread` is inlined into `CBaseEntity::FireBullets` and draws x/y via + the global `CUniformRandomStream` (`_ZTV20CUniformRandomStream` + 8, slot 1 + = `RandomFloat(float,float)`; confirmed against `libvstdlib.so`). The hook + returns 0 for those draws only when the calling frame's `this` (at + `ebp+8`) is the local server player, so every pellet follows the exact shot + direction. NPC fire and the client's prediction stream keep normal values. - This attacks the random cone offset only. The cone size, the pistol's `m_flAccuracyPenalty` growth, the server view punch added to `GetAutoaimVector`, and any damage falloff are server-side state. In -- cgit v1.2.3