bevy/crates/bevy_ecs/src/query
Chris Russell 25cb339a12
Don't ignore default query filters for EntityRef or EntityMut (#20163)
# Objective

Don't ignore default query filters for `EntityRef` or `EntityMut`.

Currently, `Query<EntityRef>` will include entities with a `Disabled`
component, even though queries like `Query<()>` or `Query<Entity>` would
not. This was noticed in
https://github.com/bevyengine/bevy/pull/19711#discussion_r2205981065.

## Solution

Change `Access::contains` to completely ignore read access and just look
at filters and archetypal access. Filters covers `With`, `Without`, `&`,
and `&mut`, while archetypal covers `Has` and `Allows`.

Note that `Option<&Disabled>` will no longer count as a use of
`Disabled`, though.
2025-07-17 19:23:41 +00:00
..
access.rs Don't ignore default query filters for EntityRef or EntityMut (#20163) 2025-07-17 19:23:41 +00:00
builder.rs Let FilteredEntity(Ref|Mut) receive access when nested. (#18236) 2025-05-05 23:23:46 +00:00
error.rs ECS: put strings only used for debug behind a feature (#19558) 2025-06-18 20:15:25 +00:00
fetch.rs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
filter.rs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
iter.rs Remove 's lifetime from WorldQuery::Fetch (#19720) 2025-06-19 00:58:21 +00:00
mod.rs Have System::run_unsafe return Result. (#19145) 2025-07-03 21:48:09 +00:00
par_iter.rs Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
state.rs Fix issue 19734: add dependency on bevy_utils for the bevy_ecs test. (#19738) 2025-06-21 15:05:04 +00:00
world_query.rs Remove 's lifetime from WorldQuery::Fetch (#19720) 2025-06-19 00:58:21 +00:00