Skip to content

Commit

Permalink
Exclusive systems can now be used for one-shot systems (bevyengine#11560
Browse files Browse the repository at this point in the history
)

Joy notified me that exclusive systems should now work (they may have
always worked, I don't know), so here's a quick change to the
documentation.
  • Loading branch information
Trashtalk217 authored and tjamaan committed Feb 6, 2024
1 parent 7b95b18 commit 261365b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions crates/bevy_ecs/src/system/system_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ impl World {
/// # Limitations
///
/// - Stored systems cannot be recursive, they cannot call themselves through [`Commands::run_system`](crate::system::Commands).
/// - Exclusive systems cannot be used.
///
/// # Examples
///
Expand Down Expand Up @@ -239,7 +238,6 @@ impl World {
/// # Limitations
///
/// - Stored systems cannot be recursive, they cannot call themselves through [`Commands::run_system`](crate::system::Commands).
/// - Exclusive systems cannot be used.
///
/// # Examples
///
Expand Down Expand Up @@ -505,6 +503,17 @@ mod tests {
assert_eq!(output, NonCopy(3));
}

#[test]
fn exclusive_system() {
let mut world = World::new();
let exclusive_system_id = world.register_system(|world: &mut World| {
world.spawn_empty();
});
let entity_count = world.entities.len();
let _ = world.run_system(exclusive_system_id);
assert_eq!(world.entities.len(), entity_count + 1);
}

#[test]
fn nested_systems() {
use crate::system::SystemId;
Expand Down

0 comments on commit 261365b

Please sign in to comment.