Skip to content

Commit

Permalink
Don't register sparse sets for relations.
Browse files Browse the repository at this point in the history
  • Loading branch information
OptimisticPeach authored and BoxyUwU committed Jul 7, 2021
1 parent 6bf0160 commit b768f5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_ecs/src/storage/sparse_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 1 addition & 9 deletions crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,7 @@ impl World {
&mut self,
descriptor: ComponentDescriptor,
) -> Result<RelationKindId, RelationsError> {
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`.
Expand Down

0 comments on commit b768f5e

Please sign in to comment.