summaryrefslogtreecommitdiffstats
path: root/src/hl2h.h
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-27 15:49:54 +0100
committersalmonik <salmonik@tuta.io>2026-10-27 15:49:54 +0100
commit1dd3a4d504e98b8d18f236cb1df1fea366ddc36e (patch)
tree3beefbc8641ef409597cd2ee4e65f948338bfbbe /src/hl2h.h
parentSpread control: add server RandomSeed GOT diagnostic/override (diff)
downloadhl2h-1dd3a4d504e98b8d18f236cb1df1fea366ddc36e.tar.gz
hl2h-1dd3a4d504e98b8d18f236cb1df1fea366ddc36e.zip
Spread control: override the server FireBullets seed for the local player
The installed 2024 server ignores the client usercmd random_seed and uses its own shot seed. Force the server's CBaseEntity::FireBullets RandomSeed call for the local player only: - hook the server.so RandomSeed GOT slot (R_386_JUMP_SLOT at 0xce1348); - read the FireBullets `this` from the caller frame and compare it with the local server player base; - replace the seed with the precomputed best single/shotgun window and step it per pellet; NPC shots and everything else pass through. - client prediction still uses the same chosen usercmd seed, so both sides agree on the spread pattern.
Diffstat (limited to '')
-rw-r--r--src/hl2h.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/hl2h.h b/src/hl2h.h
index ef8e8d6..285b591 100644
--- a/src/hl2h.h
+++ b/src/hl2h.h
@@ -151,6 +151,8 @@ bool silent_aim_apply(CUserCmd *cmd);
151bool melee_weapon_active(void *local_ent); 151bool melee_weapon_active(void *local_ent);
152bool melee_aimbot_apply(CUserCmd *cmd); 152bool melee_aimbot_apply(CUserCmd *cmd);
153bool spread_control_apply(CUserCmd *cmd, void *local_ent); 153bool spread_control_apply(CUserCmd *cmd, void *local_ent);
154int spread_best_seed(int pellets);
155extern int g_spread_pellets;
154enum FeatureId { 156enum FeatureId {
155 FEAT_BHOP = 0, 157 FEAT_BHOP = 0,
156 FEAT_ABH = 1, 158 FEAT_ABH = 1,