diff --git a/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs b/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs index 168d3739e2..92f71362ea 100644 --- a/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs +++ b/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs @@ -568,19 +568,19 @@ impl ExecutorState { should_run &= system_conditions_met; - // SAFETY: - // - The caller ensures that `world` has permission to read any data - // required by the system. - // - `update_archetype_component_access` has been called for system. - let valid_params = unsafe { system.validate_param_unsafe(world) }; - - if !valid_params { - warn_system_skipped!("System", system.name()); - self.skipped_systems.insert(system_index); + if should_run { + // SAFETY: + // - The caller ensures that `world` has permission to read any data + // required by the system. + // - `update_archetype_component_access` has been called for system. + let valid_params = unsafe { system.validate_param_unsafe(world) }; + if !valid_params { + warn_system_skipped!("System", system.name()); + self.skipped_systems.insert(system_index); + } + should_run &= valid_params; } - should_run &= valid_params; - should_run } diff --git a/crates/bevy_ecs/src/schedule/executor/simple.rs b/crates/bevy_ecs/src/schedule/executor/simple.rs index 12e257624b..3a7dd05397 100644 --- a/crates/bevy_ecs/src/schedule/executor/simple.rs +++ b/crates/bevy_ecs/src/schedule/executor/simple.rs @@ -81,14 +81,14 @@ impl SystemExecutor for SimpleExecutor { should_run &= system_conditions_met; let system = &mut schedule.systems[system_index]; - let valid_params = system.validate_param(world); - - if !valid_params { - warn_system_skipped!("System", system.name()); + if should_run { + let valid_params = system.validate_param(world); + if !valid_params { + warn_system_skipped!("System", system.name()); + } + should_run &= valid_params; } - should_run &= valid_params; - #[cfg(feature = "trace")] should_run_span.exit(); diff --git a/crates/bevy_ecs/src/schedule/executor/single_threaded.rs b/crates/bevy_ecs/src/schedule/executor/single_threaded.rs index 5cc52003a0..3ae907c4f5 100644 --- a/crates/bevy_ecs/src/schedule/executor/single_threaded.rs +++ b/crates/bevy_ecs/src/schedule/executor/single_threaded.rs @@ -87,14 +87,14 @@ impl SystemExecutor for SingleThreadedExecutor { should_run &= system_conditions_met; let system = &mut schedule.systems[system_index]; - let valid_params = system.validate_param(world); - - if !valid_params { - warn_system_skipped!("System", system.name()); + if should_run { + let valid_params = system.validate_param(world); + if !valid_params { + warn_system_skipped!("System", system.name()); + } + should_run &= valid_params; } - should_run &= valid_params; - #[cfg(feature = "trace")] should_run_span.exit();