Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Union Relationship Ref to Wildcard (Edge Case) #765

Closed
Epsola opened this issue Jul 12, 2022 · 3 comments
Closed

Union Relationship Ref to Wildcard (Edge Case) #765

Epsola opened this issue Jul 12, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Epsola
Copy link

Epsola commented Jul 12, 2022

Describe the bug
Creating this as a bug so that it doesn't get forgotten. There is an issue with queries and union relationship enums. See chat for details...

To Reproduce
See discord discussion

@Epsola Epsola added the bug Something isn't working label Jul 12, 2022
@SanderMertens
Copy link
Owner

SanderMertens commented Jul 13, 2022

Bit more context (before the discord thread expires):

It looks like there is an issue with queries for union relationships, where the union relationship is resolved as a reference (from another entity, like a prefab or parent).

The issue shows up as a query attempting to resolve a wildcard id on a reference, which fails.

@KenthJohan
Copy link

A related issue when a query term uses parent union:

ECS_ENTITY(world, Movement, EcsUnion);
ECS_TAG(world, Walking);
ECS_TAG(world, Running);
ecs_query_t *q = ecs_query_init(world, &(ecs_query_desc_t){
.filter.terms = {{.id = ecs_pair(Movement, Running), .src.trav = EcsChildOf, .src.flags = EcsUp}}
});
ecs_entity_t e0 = ecs_new_entity(world, "e0");
ecs_add_pair(world, e0, Movement, Running);
ecs_entity_t e1 = ecs_new_entity(world, "e1");
ecs_add_pair(world, e1, EcsChildOf, e0);

Gives: fatal: flecs.c: 8122: assert: ecs_id_is_valid(world, id) INVALID_PARAMETER

@SanderMertens
Copy link
Owner

Closing this issue, as in v4 union relationships are no longer handled by cached queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants