@@ -38286,7 +38286,6 @@ int flecs_term_finalize(
3828638286 ecs_term_ref_t *src = &term->src;
3828738287 ecs_term_ref_t *first = &term->first;
3828838288 ecs_term_ref_t *second = &term->second;
38289- ecs_flags64_t first_flags = ECS_TERM_REF_FLAGS(first);
3829038289 ecs_flags64_t second_flags = ECS_TERM_REF_FLAGS(second);
3829138290
3829238291 if (first->name && (first->id & ~EcsTermRefFlags)) {
@@ -38465,10 +38464,9 @@ int flecs_term_finalize(
3846538464 }
3846638465
3846738466 if (first_entity && !ecs_term_match_0(term)) {
38468- bool first_is_self = (first_flags & EcsTraverseFlags) == EcsSelf;
3846938467 ecs_record_t *first_record = flecs_entities_get(world, first_entity);
3847038468 ecs_table_t *first_table = first_record ? first_record->table : NULL;
38471-
38469+
3847238470 bool first_can_isa = false;
3847338471 if (first_table) {
3847438472 first_can_isa = (first_table->flags & EcsTableHasIsA) != 0;
@@ -38477,14 +38475,14 @@ int flecs_term_finalize(
3847738475 }
3847838476 }
3847938477
38480- (void)first_is_self;
3848138478 if (flecs_components_get(world, ecs_pair(EcsIsA, first->id)) ||
3848238479 (cr_flags & EcsIdInheritable) || first_can_isa)
3848338480 {
3848438481 term->flags_ |= EcsTermIdInherited;
3848538482 } else {
3848638483#ifdef FLECS_DEBUG
38487- if (!first_is_self) {
38484+ ecs_flags64_t first_flags = ECS_TERM_REF_FLAGS(first);
38485+ if ((first_flags & EcsTraverseFlags) != EcsSelf) {
3848838486 ecs_query_impl_t *q = flecs_query_impl(ctx->query);
3848938487 if (q) {
3849038488 ECS_TERMSET_SET(q->final_terms, 1u << ctx->term_index);
@@ -60221,9 +60219,7 @@ void flecs_rtt_init_default_hooks_struct(
6022160219 ecs_entity_t component,
6022260220 const ecs_type_info_t *ti)
6022360221{
60224- /* Obtain struct information to figure out what members it contains: */
60225- const EcsStruct *struct_info = ecs_get(world, component, EcsStruct);
60226- ecs_assert(struct_info != NULL, ECS_INTERNAL_ERROR, NULL);
60222+ ecs_assert(ecs_has(world, component, EcsStruct), ECS_INTERNAL_ERROR, NULL);
6022760223
6022860224 /* These flags will be set to true if we determine we need to generate a
6022960225 * hook of a particular type: */
@@ -61330,8 +61326,7 @@ int flecs_meta_serialize_struct(
6133061326 ecs_size_t offset,
6133161327 ecs_vec_t *ops)
6133261328{
61333- const EcsStruct *ptr = ecs_get(world, type, EcsStruct);
61334- ecs_assert(ptr != NULL, ECS_INTERNAL_ERROR, NULL);
61329+ ecs_assert(ecs_has(world, type, EcsStruct), ECS_INTERNAL_ERROR, NULL);
6133561330
6133661331 int32_t cur, first = ecs_vec_count(ops);
6133761332 ecs_meta_op_t *op = flecs_meta_ops_add(ops, EcsOpPushStruct);
@@ -84110,11 +84105,17 @@ bool flecs_query_dispatch(
8411084105 ecs_query_run_ctx_t *ctx);
8411184106
8411284107static
84113- bool flecs_query_record_inherited(
84114- const ecs_table_t *table,
84115- const ecs_table_record_t *tr)
84108+ int16_t flecs_query_next_column_w_inherited(
84109+ const ecs_world_t *world,
84110+ ecs_table_t *table,
84111+ const ecs_table_record_t *tr,
84112+ ecs_id_t id,
84113+ int32_t column)
8411684114{
84117- return !ecs_id_match(table->type.array[tr->index], tr->hdr.cr->id);
84115+ if (!ecs_id_match(table->type.array[tr->index], tr->hdr.cr->id)) {
84116+ return flecs_query_next_inherited_column(world, table, id, column);
84117+ }
84118+ return flecs_query_next_column(table, id, column);
8411884119}
8411984120
8412084121bool flecs_query_select_w_id(
@@ -84163,13 +84164,8 @@ bool flecs_query_select_w_id(
8416384164 tr = (const ecs_table_record_t*)op_ctx->it.cur;
8416484165 ecs_assert(tr != NULL, ECS_INTERNAL_ERROR, NULL);
8416584166 table = tr->hdr.table;
84166- if (flecs_query_record_inherited(table, tr)) {
84167- op_ctx->column = flecs_query_next_inherited_column(
84168- ctx->world, table, cr->id, op_ctx->column);
84169- } else {
84170- op_ctx->column = flecs_query_next_column(
84171- table, cr->id, op_ctx->column);
84172- }
84167+ op_ctx->column = flecs_query_next_column_w_inherited(
84168+ ctx->world, table, tr, cr->id, op_ctx->column);
8417384169 op_ctx->remaining --;
8417484170 }
8417584171
@@ -84234,13 +84230,8 @@ bool flecs_query_with(
8423484230 }
8423584231
8423684232 tr = (const ecs_table_record_t*)op_ctx->it.cur;
84237- if (flecs_query_record_inherited(table, tr)) {
84238- op_ctx->column = flecs_query_next_inherited_column(
84239- ctx->world, table, cr->id, op_ctx->column);
84240- } else {
84241- op_ctx->column = flecs_query_next_column(
84242- table, cr->id, op_ctx->column);
84243- }
84233+ op_ctx->column = flecs_query_next_column_w_inherited(
84234+ ctx->world, table, tr, cr->id, op_ctx->column);
8424484235 ecs_assert(op_ctx->column != -1, ECS_INTERNAL_ERROR, NULL);
8424584236 }
8424684237
@@ -96234,13 +96225,11 @@ int flecs_expr_member_visit_eval(
9623496225 ecs_os_memcpy(ECS_OFFSET(out->value.ptr, i * size),
9623596226 ECS_OFFSET(expr->value.ptr, node->swizzle[i]), size);
9623696227 }
96237- out->value.type = node->node.type;
96238- out->owned = false;
9623996228 } else {
9624096229 out->value.ptr = ECS_OFFSET(expr->value.ptr, node->offset);
96241- out->value.type = node->node.type;
96242- out->owned = false;
9624396230 }
96231+ out->value.type = node->node.type;
96232+ out->owned = false;
9624496233
9624596234 flecs_expr_stack_pop(ctx->stack);
9624696235 return 0;
0 commit comments