diff options
-rw-r--r-- | ecs/src/component/storage.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ecs/src/component/storage.rs b/ecs/src/component/storage.rs index 944beb3..f8b5b20 100644 --- a/ecs/src/component/storage.rs +++ b/ecs/src/component/storage.rs @@ -240,6 +240,11 @@ impl Storage continue; } + // There shouldn't be duplicate archetype indices in the lookup entry + if lookup_entry.archetype_indices.contains(&archetype_index) { + continue; + } + if lookup_entry.component_ids.is_subset(&comp_ids_set) { lookup_entry.archetype_indices.push(archetype_index); } |