addressed comments

This commit is contained in:
Trashtalk 2025-07-13 18:38:50 +00:00
parent e3ccd1b8e5
commit 57581349b9
3 changed files with 5 additions and 6 deletions

View File

@ -70,6 +70,7 @@
use crate::{
component::{ComponentId, Components, StorageType},
query::FilteredAccess,
resource::IsResource,
world::{FromWorld, World},
};
use bevy_ecs_macros::{Component, Resource};
@ -143,6 +144,8 @@ impl FromWorld for DefaultQueryFilters {
let mut filters = DefaultQueryFilters::empty();
let disabled_component_id = world.register_component::<Disabled>();
filters.register_disabling_component(disabled_component_id);
let is_resource_component_id = world.register_component::<IsResource>();
filters.register_disabling_component(is_resource_component_id);
filters
}
}

View File

@ -2174,10 +2174,7 @@ mod tests {
world.spawn((B(0), C(0)));
world.spawn(C(0));
let mut df = DefaultQueryFilters::empty();
df.register_disabling_component(world.register_component::<C>());
world.insert_resource(df);
world.register_disabling_component::<IsResource>();
world.register_disabling_component::<C>();
// Without<C> only matches the first entity
let mut query = QueryState::<()>::new(&mut world);

View File

@ -22,7 +22,7 @@ use crate::{
event::BufferedEvent,
lifecycle::{ComponentHooks, ADD, DESPAWN, INSERT, REMOVE, REPLACE},
prelude::{Add, Despawn, Insert, Remove, Replace},
resource::{IsResource, ResourceEntity, TypeErasedResource},
resource::{ResourceEntity, TypeErasedResource},
};
pub use bevy_ecs_macros::FromWorld;
use bevy_utils::prelude::DebugName;
@ -170,7 +170,6 @@ impl World {
// This sets up `Disabled` as a disabling component, via the FromWorld impl
self.init_resource::<DefaultQueryFilters>();
self.register_disabling_component::<IsResource>();
}
/// Creates a new empty [`World`].
///