summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-28 13:54:16 +0100
committersalmonik <salmonik@tuta.io>2026-10-28 13:54:16 +0100
commitd156c4d06abca9284cb116063494355f53354d86 (patch)
tree5289eb9a99716af4fb32448adfd07a89748a6c84 /CONTEXT.md
parentMelee: surface weapon state across maps; reset stale caches (diff)
downloadhl2h-d156c4d06abca9284cb116063494355f53354d86.tar.gz
hl2h-d156c4d06abca9284cb116063494355f53354d86.zip
Handles: use the 11-bit networked EHANDLE entity index
The client m_hActiveWeapon is a networked EHANDLE: low 11 bits are the entity index and the rest is the serial. Masking with 0xFFFF included serial bits, so on later maps the weapon index became garbage (e.g. 49184/12319) and melee killbot could not recognize the crowbar. Use 0x7FF for client and server active-weapon handles, weapon owner checks and item-ESP weapon skips. Document the layout in CONTEXT.
Diffstat (limited to '')
-rw-r--r--CONTEXT.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index a9b85b9..5f27572 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -283,6 +283,10 @@ vocabulary / decisions.
283- Never pipe-mask build failures: 283- Never pipe-mask build failures:
284 `./build.sh > /tmp/build.log 2>&1; echo rc=$?`. 284 `./build.sh > /tmp/build.log 2>&1; echo rc=$?`.
285- `CHLClient` slot numbers: `CreateMove` 21, `FrameStageNotify` 35. 285- `CHLClient` slot numbers: `CreateMove` 21, `FrameStageNotify` 35.
286- Networked EHANDLE values use an 11-bit entity index in the low bits; bits
287 11+ are the serial. Mask with `0x7FF`, not the local `CBaseHandle` 16-bit
288 mask. This caused active-weapon lookups to produce bogus indices after a
289 map change once the weapon serial was nonzero (melee killbot looked dead).
286- `ISurface` binary slot = SDK header slot + 4; see `src/ISURFACE_STATUS.md`. 290- `ISurface` binary slot = SDK header slot + 4; see `src/ISURFACE_STATUS.md`.
287- Silent aim and ABH temporarily replace the usercmd view; silent aim preserves 291- Silent aim and ABH temporarily replace the usercmd view; silent aim preserves
288 movement, ABH intentionally zeroes it for the jump tick. 292 movement, ABH intentionally zeroes it for the jump tick.