ent_next (ENTITY*);

All level entities are sorted into an internal list. This function returns a pointer to the first entity in the list when the entity parameter is NULL, and a pointer to the next entity otherwise. When the last entity in the list is given as parameter, the function returns NULL. Using this function, something can be done to all entities in a level, or an entity with a certain parameter can be found.


ENTITY* - entity pointer or NULL.


when ENTITY* == NULL: Pointer to first entity
when ENTITY* == any entity: Pointer to next entity
when ENTITY* == last entity: NULL




Example (lite-C):

function hide_all_ents()
// repeat for all entities
  for(you = ent_next(NULL); you; you = ent_next(you)) 
    set(you,INVISIBLE); // make entity invisible

See also:

ent_vertices, ent_for_name, ent_pvs

► latest version online