Skip to content
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

Remove child from parent when it is despawned #386

Merged
merged 4 commits into from
Sep 1, 2020
Merged

Remove child from parent when it is despawned #386

merged 4 commits into from
Sep 1, 2020

Conversation

CleanCut
Copy link
Member

@CleanCut CleanCut commented Aug 29, 2020

despawn_with_children_recursive was despawning an entity and all of its children, but did not remove itself as a child from its own parent.

There is one question I would like answered. I will ask it in a comment on the line I am concerned about.

This is my first foray into the internals of bevy. I would appreciate any guidance on what I may have done wrong or could be done better. Please feel free to push commits directly to this branch if you have write permissions (I've enabled "allow edits by maintainers").

Resolves #352

/cc @ncallaway @cart

// the grandparent tuple (1, 1) and (0, 0) tuples remaining.
assert_eq!(
results,
vec![(0u32, 0u64), (0u32, 0u64), (0u32, 0u64), (1u32, 1u64)]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Is the order of entities stable? If not, then we should probably alter the grandparent to also be (0u32, 0u64) to avoid a flaky test.

@karroffel karroffel added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events labels Aug 30, 2020
@cart cart merged commit 3d6d243 into bevyengine:master Sep 1, 2020
mrk-its pushed a commit to mrk-its/bevy that referenced this pull request Oct 6, 2020
Remove child from parent when it is despawned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Despawned Node Entities are not removed from their parent Node's Children
4 participants