Skip to content

Commit

Permalink
Fix archetype generation being incorrectly updated for systems (bevye…
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Aug 28, 2020
1 parent 63fd4ae commit f858087
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/bevy_ecs/src/schedule/parallel_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ impl ExecutorStage {
systems: &[Arc<Mutex<Box<dyn System>>>],
schedule_changed: bool,
) {
let start_archetypes_generation = world.archetypes_generation();

// if the schedule has changed, clear executor state / fill it with new defaults
if schedule_changed {
self.system_dependencies.clear();
Expand Down Expand Up @@ -428,7 +430,11 @@ impl ExecutorStage {
}
}

self.last_archetypes_generation = world.archetypes_generation();
// If world's archetypes_generation is the same as it was before running any systems then
// we can assume that all systems have correct archetype accesses.
if start_archetypes_generation == world.archetypes_generation() {
self.last_archetypes_generation = world.archetypes_generation();
}
}
}

Expand Down

0 comments on commit f858087

Please sign in to comment.