File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
crates/bevy_ecs/src/world Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -887,7 +887,7 @@ pub(crate) unsafe fn get_mut_by_id(
887
887
/// Caller is responsible to drop component data behind returned pointer.
888
888
///
889
889
/// # Safety
890
- /// - `location` must be within bounds of the given archetype and `entity` must exist inside the `archetype `
890
+ /// - `location.table_row ` must be in bounds of column of component id `component_id `
891
891
/// - `component_id` must be valid
892
892
/// - `components` must come from the same world as `self`
893
893
/// - The relevant table row **must be removed** by the caller once all components are taken, without dropping the value
@@ -900,13 +900,13 @@ pub(crate) unsafe fn take_component<'a>(
900
900
entity : Entity ,
901
901
location : EntityLocation ,
902
902
) -> OwningPtr < ' a > {
903
+ // SAFETY: caller promises component_id to be valid
903
904
let component_info = components. get_info_unchecked ( component_id) ;
904
905
let removed_components = removed_components. get_or_insert_with ( component_id, Vec :: new) ;
905
906
removed_components. push ( entity) ;
906
907
match component_info. storage_type ( ) {
907
908
StorageType :: Table => {
908
909
let table = & mut storages. tables [ location. table_id ] ;
909
- // SAFETY: archetypes will always point to valid columns
910
910
let components = table. get_column_mut ( component_id) . unwrap ( ) ;
911
911
// SAFETY:
912
912
// - archetypes only store valid table_rows
You can’t perform that action at this time.
0 commit comments