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

Don't overwrite schedules when adding plugin #236

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

johanhelsing
Copy link
Contributor

@johanhelsing johanhelsing commented Nov 10, 2023

Objective

If user systems were added to any of the physics schedules (e.g. PostProcessCollisions) before PhysicsPlugins are added, the schedules would be replaced when adding PhysicsPlugins, effectively ignoring the user's system.

app
    .add_systems(PostProcessColllisions, filter_collisions)
    .add_plugins(PhysicsPlugins);

Solution

Solve it by using edit_schedule instead of add_schedule.

Changelog

  • Systems can now be added to PostProcessSchedule, PhysicsScedule and SubstepSchedule before adding PhysicsPlugins

If user systems were added to any of the physics schedules (e.g.
`PostProcessCollisions`) before `PhysicsPlugins` are added, the
schedules would be replaced when adding `PhysicsPlugins`, effectively
ignoring the user's system.

```rust
app
    .add_system(PostProcessColllisions, filter_collisions)
    .add_plugins(PhysicsPlugins);
```

Solve it by using `edit_schedule` instead of `add_schedule`.
@Jondolf Jondolf added C-Enhancement New feature or request A-Scheduling Relates to scheduling or system sets labels Nov 10, 2023
@Jondolf Jondolf merged commit 2eb3492 into Jondolf:main Nov 10, 2023
4 checks passed
@johanhelsing johanhelsing deleted the edit-schedule branch November 10, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Scheduling Relates to scheduling or system sets C-Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants