Skip to content

Fix wrong method call in relationship replacement command #18824

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

Merged
merged 1 commit into from
Apr 14, 2025

Conversation

JaySpruce
Copy link
Member

Fixes a small mix-up from #18058, which added bulk relationship replacement methods.

EntityCommands::replace_related_with_difference calls EntityWorldMut::replace_children_with_difference instead of EntityWorldMut::replace_related_with_difference, which means it always operates on the ChildOf relationship instead of the R: Relationship generic it's provided.

EntityCommands::replace_children_with_difference takes an R: Relationship generic that it shouldn't, but it accidentally works correctly on main because it calls the above method.

@JaySpruce JaySpruce added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 12, 2025
@JaySpruce JaySpruce added this to the 0.16 milestone Apr 12, 2025
@cart cart added this pull request to the merge queue Apr 14, 2025
Merged via the queue into bevyengine:main with commit e3384bb Apr 14, 2025
39 checks passed
mockersf pushed a commit that referenced this pull request Apr 14, 2025
Fixes a small mix-up from #18058, which added bulk relationship
replacement methods.

`EntityCommands::replace_related_with_difference` calls
`EntityWorldMut::replace_children_with_difference` instead of
`EntityWorldMut::replace_related_with_difference`, which means it always
operates on the `ChildOf` relationship instead of the `R: Relationship`
generic it's provided.

`EntityCommands::replace_children_with_difference` takes an `R:
Relationship` generic that it shouldn't, but it accidentally works
correctly on `main` because it calls the above method.
@JaySpruce JaySpruce deleted the fix_relation_command branch April 14, 2025 21:02
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 S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants