Skip to content

Commit

Permalink
Merge pull request #131 from NiklasEi/fix_crash_with_non_default_exit…
Browse files Browse the repository at this point in the history
…_criteria

Workaround for correct scheduling with non default exit criteria
  • Loading branch information
NiklasEi authored Apr 14, 2023
2 parents 0acd104 + ba8aff6 commit c71df8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Dynamic asset files can be loaded multiple times now
- This allows re-entering a loading state containing dynamic assets (see [#126](https://github.com/NiklasEi/bevy_asset_loader/issues/126))
- and loading dynamic assets in multiple states (see [#123](https://github.com/NiklasEi/bevy_asset_loader/issues/123))
- Fix crash with non default exit criteria (see [#121](https://github.com/NiklasEi/bevy_asset_loader/issues/121))

## v0.16.0
- Remove features coming from optional dependencies
Expand Down
10 changes: 6 additions & 4 deletions bevy_asset_loader/src/loading_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,7 @@ where
.configure_set(
LoadingStateSet(self.loading_state.clone())
.after(CoreSet::StateTransitions)
.before(CoreSet::Update)
.run_if(in_state(self.loading_state.clone())),
.before(CoreSet::Update),
);
let mut loading_state_schedule = app.get_schedule_mut(loading_state_schedule).unwrap();
loading_state_schedule
Expand Down Expand Up @@ -424,11 +423,14 @@ where
app.add_system(
run_loading_state::<S>
.in_set(TrackedProgressSet)
.in_base_set(LoadingStateSet(self.loading_state)),
.in_base_set(LoadingStateSet(self.loading_state.clone()))
.run_if(in_state(self.loading_state)),
);
#[cfg(not(feature = "progress_tracking"))]
app.add_system(
run_loading_state::<S>.in_base_set(LoadingStateSet(self.loading_state.clone())),
run_loading_state::<S>
.in_base_set(LoadingStateSet(self.loading_state.clone()))
.run_if(in_state(self.loading_state)),
);
}

Expand Down

0 comments on commit c71df8b

Please sign in to comment.