fix inconsistent placement of *
@@ -381,7 +381,6 @@ static
void add_entity_to_type(
ecs_type_t type,
ecs_entity_t add,
- ecs_entity_t replace,
ecs_ids_t *out)
{
int32_t count = ecs_vector_count(type);
@@ -391,9 +390,6 @@ void add_entity_to_type(
int32_t i, el = 0;
for (i = 0; i < count; i ++) {
ecs_entity_t e = array[i];
- if (e == replace) {
- continue;
- }
if (e > add && !added) {
out->array[el ++] = add;
@@ -459,41 +455,6 @@ void create_backlink_after_remove(
}
}
-static
-ecs_entity_t find_xor_replace(
- ecs_world_t * world,
- ecs_table_t * table,
- ecs_type_t type,
- ecs_entity_t add)
-{
- if (table->flags & EcsTableHasXor) {
- ecs_entity_t *array = ecs_vector_first(type, ecs_entity_t);
- int32_t i, type_count = ecs_vector_count(type);
- ecs_type_t xor_type = NULL;
-
- for (i = type_count - 1; i >= 0; i --) {
- ecs_entity_t e = array[i];
- if (ECS_HAS_ROLE(e, XOR)) {
- ecs_entity_t e_type = e & ECS_COMPONENT_MASK;
- const EcsType *type_ptr = ecs_get(world, e_type, EcsType);
- ecs_assert(type_ptr != NULL, ECS_INTERNAL_ERROR, NULL);
-
- if (ecs_type_has_id(
- world, type_ptr->normalized, add, true))
- {
- xor_type = type_ptr->normalized;
- }
- } else if (xor_type) {
- if (ecs_type_has_id(world, xor_type, e, true)) {
- return e;
- }
- }
- }
- }
-
- return 0;
-}
-
int32_t flecs_table_switch_from_case(
const ecs_world_t *world,
const ecs_table_t *table,
@@ -562,14 +523,7 @@ ecs_table_t *find_or_create_table_include(
.count = count + 1
};
- /* If table has a XOR column, check if the entity that is being added to
- * the table is part of the XOR type, and if it is, find the current
- * entity in the table type matching the XOR type. This entity must be
- * replaced in the new table, to ensure the XOR constraint isn't
- * violated. */
- ecs_entity_t replace = find_xor_replace(world, node, type, add);
-
- add_entity_to_type(type, add, replace, &entities);
+ add_entity_to_type(type, add, &entities);
ecs_table_t *result = flecs_table_find_or_create(world, &entities);
