Entity index
From Valve Developer Community
An entity index is a unique integer given to every entity by the engine. It allows the same entity to be referred to across library boundaries, but will be different on the client and server unless an edict is used. Within the client and server, pointers to CBaseEntity
are more useful.
There can be up to 4096 entities in the index. The first 2048 entries are reserved for entities with edicts, which cross the client/server divide.


CHandle
for long-term storage.Usage
- Shared
-
int CBaseEntity::entindex()
- Server
-
edict_t* INDEXENT( int iEdictNum )
-
int ENTINDEX( edict_t* pEdict )
-
CEntInfo* gEntList.GetEntInfoPtrByIndex(int)
- Functions below are not available in Alien Swarm:
-
int engine->IndexOfEdict(edict_t)
-
edict_t engine->PEntityOfEntIndex(int)
(networked ents only) - Client
-
C_BaseEntity ClientEntityList().GetBaseEntity(int)