Apply buffers in ParamSet
(#4677)
# Objective - Fix https://github.com/bevyengine/bevy/issues/4676 ## Solution - Fixes https://github.com/bevyengine/bevy/issues/4676 - I have no reason to think this isn't sound, but `ParamSet` is a bit spooky
This commit is contained in:
parent
96b4956126
commit
ec805e9e07
@ -250,6 +250,10 @@ pub fn impl_param_set(_input: TokenStream) -> TokenStream {
|
|||||||
#param.new_archetype(archetype, system_meta);
|
#param.new_archetype(archetype, system_meta);
|
||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn apply(&mut self, world: &mut World) {
|
||||||
|
self.0.apply(world)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ mod tests {
|
|||||||
query::{Added, Changed, Or, With, Without},
|
query::{Added, Changed, Or, With, Without},
|
||||||
schedule::{Schedule, Stage, SystemStage},
|
schedule::{Schedule, Stage, SystemStage},
|
||||||
system::{
|
system::{
|
||||||
IntoExclusiveSystem, IntoSystem, Local, NonSend, NonSendMut, ParamSet, Query,
|
Commands, IntoExclusiveSystem, IntoSystem, Local, NonSend, NonSendMut, ParamSet, Query,
|
||||||
RemovedComponents, Res, ResMut, System, SystemState,
|
RemovedComponents, Res, ResMut, System, SystemState,
|
||||||
},
|
},
|
||||||
world::{FromWorld, World},
|
world::{FromWorld, World},
|
||||||
@ -906,4 +906,23 @@ mod tests {
|
|||||||
expected_ids
|
expected_ids
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn commands_param_set() {
|
||||||
|
// Regression test for #4676
|
||||||
|
let mut world = World::new();
|
||||||
|
let entity = world.spawn().id();
|
||||||
|
|
||||||
|
run_system(
|
||||||
|
&mut world,
|
||||||
|
move |mut commands_set: ParamSet<(Commands, Commands)>| {
|
||||||
|
commands_set.p0().entity(entity).insert(A);
|
||||||
|
commands_set.p1().entity(entity).insert(B);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
let entity = world.entity(entity);
|
||||||
|
assert!(entity.contains::<A>());
|
||||||
|
assert!(entity.contains::<B>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user