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.
Parameters:
ENTITY* - entity pointer or NULL.
Returns:
when ENTITY* == NULL: |
Pointer to first entity |
when ENTITY* == any entity: |
Pointer to next entity |
when ENTITY* == last entity: |
NULL |
Speed:
Fast
Remarks:
- The parameters of all entities can be read, but changing position parameters only has an effect on dynamic entities (with an action attached, or created by ent_create).
- The function only works for level entities, not for view entities. A level must be loaded before.
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