@@ -85789,10 +85789,10 @@ bool flecs_query_trav_fixed_src_up_fixed_second(
8578985789
8579085790 /* Check if table has transitive relationship by traversing upwards */
8579185791 ecs_table_record_t *tr = NULL;
85792- ecs_search_relation(ctx->world, table, 0,
85793- ecs_pair(trav, second), trav, EcsSelf|EcsUp, NULL, NULL, &tr);
85792+ const int32_t column = ecs_search_relation(ctx->world, table, 0,
85793+ ecs_pair(trav, second), trav, EcsSelf| EcsUp, NULL, NULL, &tr);
8579485794
85795- if (!tr) {
85795+ if (column == -1 || !tr) {
8579685796 if (op->match_flags & EcsTermReflexive) {
8579785797 return flecs_query_trav_fixed_src_reflexive(op, ctx,
8579885798 &range, trav, second);
@@ -85801,7 +85801,17 @@ bool flecs_query_trav_fixed_src_up_fixed_second(
8580185801 }
8580285802 }
8580385803
85804- flecs_query_set_trav_match(op, tr, trav, second, ctx);
85804+ ecs_id_t matched = ecs_pair(trav, second);
85805+ if (trav == EcsIsA) {
85806+ matched = table->type.array[column];
85807+ }
85808+
85809+ if (op->field_index != -1) {
85810+ ecs_iter_t *it = ctx->it;
85811+ it->ids [op->field_index] = matched;
85812+ flecs_query_it_set_tr(it, op->field_index, tr);
85813+ }
85814+ flecs_query_set_vars(op, matched, ctx);
8580585815 return true;
8580685816}
8580785817
0 commit comments