File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -488,10 +488,10 @@ impl Archetype {
488
488
& self . entities
489
489
}
490
490
491
- /// Fetches the disabled entities contained in this archetype.
491
+ /// Fetches the enabled entities contained in this archetype.
492
492
#[ inline]
493
- pub fn disabled_entities ( & self ) -> & [ ArchetypeEntity ] {
494
- & self . entities [ .. self . disabled_entities as usize ]
493
+ pub fn enabled_entities ( & self ) -> & [ ArchetypeEntity ] {
494
+ & self . entities [ self . disabled_entities as usize .. ]
495
495
}
496
496
497
497
/// Get the valid table rows (i.e. non-disabled entities).
@@ -507,8 +507,7 @@ impl Archetype {
507
507
#[ inline]
508
508
pub fn entities_with_location (
509
509
& self ,
510
- ) -> impl Iterator < Item = ( Entity , EntityLocation ) > + DoubleEndedIterator + ExactSizeIterator
511
- {
510
+ ) -> impl DoubleEndedIterator < Item = ( Entity , EntityLocation ) > + ExactSizeIterator {
512
511
self . entities . iter ( ) . enumerate ( ) . map (
513
512
|( archetype_row, & ArchetypeEntity { entity, table_row } ) | {
514
513
(
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ impl DynamicScene {
60
60
world
61
61
. archetypes ( )
62
62
. iter ( )
63
- . flat_map ( bevy_ecs:: archetype:: Archetype :: entities )
63
+ . flat_map ( bevy_ecs:: archetype:: Archetype :: enabled_entities )
64
64
. map ( bevy_ecs:: archetype:: ArchetypeEntity :: id) ,
65
65
)
66
66
. extract_resources ( )
Original file line number Diff line number Diff line change @@ -106,15 +106,15 @@ impl Scene {
106
106
// Ensure that all scene entities have been allocated in the destination
107
107
// world before handling components that may contain references that need mapping.
108
108
for archetype in self . world . archetypes ( ) . iter ( ) {
109
- for scene_entity in archetype. entities ( ) {
109
+ for scene_entity in archetype. enabled_entities ( ) {
110
110
entity_map
111
111
. entry ( scene_entity. id ( ) )
112
112
. or_insert_with ( || world. spawn_empty ( ) . id ( ) ) ;
113
113
}
114
114
}
115
115
116
116
for archetype in self . world . archetypes ( ) . iter ( ) {
117
- for scene_entity in archetype. entities ( ) {
117
+ for scene_entity in archetype. enabled_entities ( ) {
118
118
let entity = * entity_map
119
119
. get ( & scene_entity. id ( ) )
120
120
. expect ( "should have previously spawned an entity" ) ;
You can’t perform that action at this time.
0 commit comments