Bevy version and features
main 9a35b6a
What you did
Added this test to the propagate module, it fails.
#[test]
fn test_remove_and_reinsert_propagate() {
let mut app = App::new();
app.add_schedule(Schedule::new(Update));
app.add_plugins(HierarchyPropagatePlugin::<TestValue>::new(Update));
let parent = app.world_mut().spawn(Propagate(TestValue(1))).id();
let child = app.world_mut().spawn_empty().insert(ChildOf(parent)).id();
app.update();
app.world_mut()
.entity_mut(parent)
.remove::<Propagate<TestValue>>()
.insert(Propagate(TestValue(1)));
app.update();
assert_eq!(
app.world_mut()
.query::<&TestValue>()
.get_many(app.world(), [parent, child]),
Ok([&TestValue(1), &TestValue(1)])
);
}
Also see #24546
What went wrong
If Propagate is removed and then immediately reinserted, the propagated components are removed.
Bevy version and features
main 9a35b6a
What you did
Added this test to the
propagatemodule, it fails.Also see #24546
What went wrong
If
Propagateis removed and then immediately reinserted, the propagated components are removed.