diff options
Diffstat (limited to 'ecs/src/query.rs')
-rw-r--r-- | ecs/src/query.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ecs/src/query.rs b/ecs/src/query.rs index b29db3d..f642156 100644 --- a/ecs/src/query.rs +++ b/ecs/src/query.rs @@ -3,7 +3,7 @@ use std::marker::PhantomData; use seq_macro::seq; -use crate::component::{Component, FromLockedOptional, Ref as ComponentRef}; +use crate::component::{Component, HandleFromEntityComponentRef, Ref as ComponentRef}; use crate::entity::Handle as EntityHandle; use crate::query::flexible::{Iter as FlexibleQueryIter, Query as FlexibleQuery}; use crate::system::{Param as SystemParam, System}; @@ -314,15 +314,13 @@ impl<ComponentRefT: ComponentRef> TermWithField for ComponentRefT world: &'world World, ) -> Self::Field<'world> { - Self::Field::from_locked_optional_component( - entity_handle - .get_component(ComponentRefT::Component::id()) - .map(|component| component.component()), + Self::Field::from_entity_component_ref( + entity_handle.get_component(ComponentRefT::Component::id()), world, ) .unwrap_or_else(|err| { panic!( - "Taking component {} lock failed: {err}", + "Creating handle to component {} failed: {err}", type_name::<ComponentRefT::Component>() ); }) |