Function ecs_get_alive


#include <include/flecs.h>

FLECS_API ecs_entity_t ecs_get_alive(const ecs_world_t *world, ecs_entity_t e)


Get alive identifier. In some cases an application may need to work with identifiers from which the generation has been stripped. A typical scenario in which this happens is when iterating relationships in an entity type.

For example, when obtaining the parent id from a ChildOf relationship, the parent (second element of the pair) will have been stored in a 32 bit value, which cannot store the entity generation. This function can retrieve the identifier with the current generation for that id.

If the provided identifier is not alive, the function will return 0.


world - The world.

e - The for which to obtain the current alive entity id.

The alive entity id if there is one, or 0 if the id is not alive.


Line 2185 in include/flecs.h.