EntRefToEntIndex Function

Retrieves the entity index from a reference or validates an entity index. The input ref is checked that it is still valid and refers to the same entity.

int EntRefToEntIndex(int ref)

Parameters

int ref

Entity reference or index.

Return Value

Entity index or returns INVALID_ENT_REFERENCE if ref is invalid.