From 52d737d359bba03b72daefdf1d2b4aac2b543b31 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 11 Apr 2024 18:14:53 +0200 Subject: fix(ecs): allow queries to contain the same components --- ecs/src/query.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ecs/src/query.rs b/ecs/src/query.rs index 9874b19..683dde7 100644 --- a/ecs/src/query.rs +++ b/ecs/src/query.rs @@ -229,10 +229,8 @@ impl QueryComponentIds .into_iter() .collect::>(); - // TODO: Make this a bit smarter. Queries with a same component can be compatible - // if one of the queries have a component the other one does not have self.component_type_ids .iter() - .any(|component_type_id| other_component_type_ids.contains(component_type_id)) + .all(|component_type_id| other_component_type_ids.contains(component_type_id)) } } -- cgit v1.2.3-18-g5258