diff --git a/crates/bevy_ecs/src/storage/sparse_set.rs b/crates/bevy_ecs/src/storage/sparse_set.rs index ab1642f9391ad..02b25c2bff744 100644 --- a/crates/bevy_ecs/src/storage/sparse_set.rs +++ b/crates/bevy_ecs/src/storage/sparse_set.rs @@ -391,6 +391,8 @@ impl SparseSets { self.relation_sets.get(relation_kind) } + // FIXME(Relationships): https://discord.com/channels/691052431525675048/749335865876021248/862199702825205760 + // FIXME(Relationships): Deal with the ability to register components with a target, and relations without one pub fn get_or_insert( &mut self, relation_kind: &RelationKindInfo, diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 0dbad8d8a0062..482bbc2dd27ae 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -190,15 +190,7 @@ impl World { &mut self, descriptor: ComponentDescriptor, ) -> Result { - let storage_type = descriptor.storage_type(); - let relation_kind = self.components.new_relationship_kind(descriptor)?; - - // ensure sparse set is created for SparseSet components - if storage_type == StorageType::SparseSet { - self.storages.sparse_sets.get_or_insert(relation_kind, None); - } - - Ok(relation_kind.id()) + Ok(self.components.new_relationship_kind(descriptor)?.id()) } /// Retrieves an [EntityRef] that exposes read-only operations for the given `entity`.