Skip to main content

ENTITY_HANDLE_INDEX_MASK

Constant ENTITY_HANDLE_INDEX_MASK 

Source
pub const ENTITY_HANDLE_INDEX_MASK: u32 = 0x3FFF;
Expand description

Mask that extracts the entity-array index from a networked CHandle value.

Source 2 packs a 14-bit edict index (entity indices run 0–16383) in the low bits of a handle with a serial number above it, so the index is recovered with this 14-bit mask. A wider mask (e.g. 0x7FFF) leaks a serial bit into the index and resolves the wrong entity for any handle with an odd serial.