ent_next ( ENTITY*);

All level entities are sorted into an internal list. This instruction 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 is given as parameter, the instruction returns NULL. With this instruction something can be done to all entities in a level - or a certain entity can be found.

The parameters of all entities can be read, but changing the parameters only has an effect on dynamic entities (with an action attached, or created by ent_create ). A level must be loaded for this instruction to work .

Parameters:

ENTITY* - entity pointer or NULL.

Returns

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

Speed:

Fast

Example (lite-C):

function hide_all_ents()
{
	you = ent_next(NULL); // retrieve first entity
 	while (you) // repeat until there are no more entities
	{ 
		set(you,INVISIBLE); // make entity invisible
 		you = ent_next(you); // get next entity
 	}
} 

See also:

ent_vertices, ent_for_name, ent_pvs

► latest version online