From d156c4d06abca9284cb116063494355f53354d86 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 13:54:16 +0100 Subject: 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. --- CONTEXT.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index a9b85b9..5f27572 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -283,6 +283,10 @@ vocabulary / decisions. - Never pipe-mask build failures: `./build.sh > /tmp/build.log 2>&1; echo rc=$?`. - `CHLClient` slot numbers: `CreateMove` 21, `FrameStageNotify` 35. +- Networked EHANDLE values use an 11-bit entity index in the low bits; bits + 11+ are the serial. Mask with `0x7FF`, not the local `CBaseHandle` 16-bit + mask. This caused active-weapon lookups to produce bogus indices after a + map change once the weapon serial was nonzero (melee killbot looked dead). - `ISurface` binary slot = SDK header slot + 4; see `src/ISURFACE_STATUS.md`. - Silent aim and ABH temporarily replace the usercmd view; silent aim preserves movement, ABH intentionally zeroes it for the jump tick. -- cgit v1.2.3