summaryrefslogtreecommitdiffstats
path: root/src/hl2h.h
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 13:19:50 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 13:19:50 +0100
commit6a7e0b3bae04a5a4667267b6a45baddeb66fc570 (patch)
tree557c31924d468345a15886ac6e75209d00c49524 /src/hl2h.h
parentStudio: drop the prop draw diagnostic (diff)
downloadhl2h-6a7e0b3bae04a5a4667267b6a45baddeb66fc570.tar.gz
hl2h-6a7e0b3bae04a5a4667267b6a45baddeb66fc570.zip
Fix No spread on the hl2_complete server build
The server RandomSeed GOT slot was hardcoded to 0xce1348, measured on the older bin/server.so. The anniversary branch loads hl2_complete/bin/server.so, whose R_386_JMP_SLOT for RandomSeed is 0xce5348, so the patch hit unrelated writable data and no spread silently did nothing. - Read the relocation from the loaded module's ELF (module_jump_slot) instead of hardcoding, with the two known offsets as fallback. - Override whenever the RandomSeed caller's `this` is the local server player (CBaseEntity::FireBullets) instead of matching a hardcoded return-address range that also moved between builds. - m_takedamage is a char (FIELD_CHARACTER) in the 2013 SDK; resolve it as such and read a byte, so the IMMUNE damage tag actually works.
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 e35e737..b7fc2f5 100644
--- a/src/hl2h.h
+++ b/src/hl2h.h
@@ -278,6 +278,8 @@ int server_npc_takedamage(int idx);
278int server_npc_turret_flags(int idx); 278int server_npc_turret_flags(int idx);
279int server_model_index(void *base); 279int server_model_index(void *base);
280void find_modules(); 280void find_modules();
281bool module_jump_slot(const char *path, const char *name, uintptr_t *vaddr,
282 uintptr_t *bias);
281void init_conmsg(); 283void init_conmsg();
282bool feature_active(int feature); 284bool feature_active(int feature);
283bool feature_has_bind(int feature); 285bool feature_has_bind(int feature);