@@ -929,17 +929,19 @@ unsafe fn take_component(
929
929
}
930
930
}
931
931
932
- fn contains_component_with_type (
932
+ /// # Safety
933
+ /// `entity_location` must be within bounds of the given archetype and `entity` must exist inside
934
+ /// the archetype
935
+ #[ inline]
936
+ unsafe fn get_component_with_type (
933
937
world : & World ,
934
938
type_id : TypeId ,
935
939
target : Option < Entity > ,
940
+ entity : Entity ,
936
941
location : EntityLocation ,
937
- ) -> bool {
938
- world
939
- . components
940
- . get_component_id ( type_id)
941
- . map ( |component_id| contains_component ( world, component_id, target, location) )
942
- . unwrap_or ( false )
942
+ ) -> Option < * mut u8 > {
943
+ let component_id = world. components . get_component_id ( type_id) ?;
944
+ get_component ( world, component_id, target, entity, location)
943
945
}
944
946
945
947
/// # Safety
@@ -956,19 +958,17 @@ unsafe fn get_component_and_ticks_with_type(
956
958
get_component_and_ticks ( world, component_id, target, entity, location)
957
959
}
958
960
959
- /// # Safety
960
- /// `entity_location` must be within bounds of the given archetype and `entity` must exist inside
961
- /// the archetype
962
- #[ inline]
963
- unsafe fn get_component_with_type (
961
+ fn contains_component_with_type (
964
962
world : & World ,
965
963
type_id : TypeId ,
966
964
target : Option < Entity > ,
967
- entity : Entity ,
968
965
location : EntityLocation ,
969
- ) -> Option < * mut u8 > {
970
- let component_id = world. components . get_component_id ( type_id) ?;
971
- get_component ( world, component_id, target, entity, location)
966
+ ) -> bool {
967
+ world
968
+ . components
969
+ . get_component_id ( type_id)
970
+ . map ( |component_id| contains_component ( world, component_id, target, location) )
971
+ . unwrap_or ( false )
972
972
}
973
973
974
974
fn contains_component (
0 commit comments