-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Incorrect handling of EntityRef/Mut Queries + Resources resulting in false conflicts #13139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
#13120 would help prevent these kinds of bugs & surprises. |
Yeah, I don't think our access model is quite right. We have reads_all and writes_all, but that's inadequately granular: components and resources are distinct. |
Probably obvious, but I'd like to point out that the opposite EntityMut and Res will also return the same error. use bevy::prelude::*;
#[derive(Resource)]
struct Foo;
fn sys(_: Query<EntityMut>, _: Res<Foo>) {}
fn main() {
App::new()
.insert_resource(Foo)
.add_systems(Update, sys)
.run();
} |
I've encountered this too, is there any progress here? |
World::resource_scope is a convenient work-around until the accesses for fn sys(world: &mut World, state: &mut SystemState<Query<EntityRef>>) {
world.resource_scope(|world, mut foo: Mut<Foo>| {
let _query = state.get(world);
});
} |
Just hit this as well, I have to switch to |
Bevy version
0.13
What you did
Have a system with
EntityRef
&ResMut<T>
.What went wrong
System should not have any access conflicts but it does.
Additional information
Minimal example to reproduce:
The text was updated successfully, but these errors were encountered: