Skip to content

Commit

Permalink
schedule_v3: fix default set for systems not being applied (bevyengin…
Browse files Browse the repository at this point in the history
…e#7350)

# Objective

`add_system(system)` without any `.in_set` configuration should land in `CoreSet::Update`.
We check that the sets are empty, but for systems there is always the `SystemTypeset`.

## Solution

- instead of `is_empty()`, check that the only set it the `SystemTypeSet`
  • Loading branch information
jakobhellermann committed Jan 24, 2023
1 parent 6e44d8a commit 671e7a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/bevy_ecs/src/schedule_v3/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,11 @@ impl ScheduleGraph {

let id = NodeId::System(self.systems.len());

if graph_info.sets.is_empty() {
if let Some(default) = self.default_set.as_ref() {
graph_info.sets.push(default.dyn_clone());
if let [single_set] = graph_info.sets.as_slice() {
if single_set.is_system_type() {
if let Some(default) = self.default_set.as_ref() {
graph_info.sets.push(default.dyn_clone());
}
}
}

Expand Down

0 comments on commit 671e7a0

Please sign in to comment.