diff options
author | HampusM <hampus@hampusmat.com> | 2024-08-14 19:58:45 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-08-14 19:58:45 +0200 |
commit | e9074af15cae7b3c354e524e9fa78cbddb20ff84 (patch) | |
tree | a7ebc15723d3d2d174300658ae6429c3b9970433 | |
parent | 79ac38c548079f8545dcf06aa443274a5e9e53fd (diff) |
fix(ecs): prevent duplicate archetype indices in lookup entries
-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); } |