Skip to content

Commit 73fd66e

Browse files
OptimisticPeachBoxyUwU
authored andcommitted
Don't register sparse sets for relations.
1 parent 4adebb3 commit 73fd66e

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

crates/bevy_ecs/src/storage/sparse_set.rs

+2
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ impl SparseSets {
391391
self.relation_sets.get(relation_kind)
392392
}
393393

394+
// FIXME(Relationships): https://discord.com/channels/691052431525675048/749335865876021248/862199702825205760
395+
// FIXME(Relationships): Deal with the ability to register components with a target, and relations without one
394396
pub fn get_or_insert(
395397
&mut self,
396398
relation_kind: &RelationKindInfo,

crates/bevy_ecs/src/world/mod.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,7 @@ impl World {
190190
&mut self,
191191
descriptor: ComponentDescriptor,
192192
) -> Result<RelationKindId, RelationsError> {
193-
let storage_type = descriptor.storage_type();
194-
let relation_kind = self.components.new_relationship_kind(descriptor)?;
195-
196-
// ensure sparse set is created for SparseSet components
197-
if storage_type == StorageType::SparseSet {
198-
self.storages.sparse_sets.get_or_insert(relation_kind, None);
199-
}
200-
201-
Ok(relation_kind.id())
193+
Ok(self.components.new_relationship_kind(descriptor)?.id())
202194
}
203195

204196
/// Retrieves an [EntityRef] that exposes read-only operations for the given `entity`.

0 commit comments

Comments
 (0)