Skip to content

Commit

Permalink
Use server_or_singleplayer condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Nov 4, 2024
1 parent be3a0f2 commit e581038
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/simple_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ impl Plugin for SimpleBoxPlugin {
.add_systems(
Update,
(
Self::apply_movement.run_if(has_authority), // Runs only on the server or a single player.
Self::handle_connections.run_if(server_running), // Runs only on the server.
Self::apply_movement.run_if(server_or_singleplayer),
Self::handle_connections.run_if(server_running),
(Self::draw_boxes, Self::read_input),
),
);
Expand Down
2 changes: 1 addition & 1 deletion examples/tic_tac_toe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl Plugin for TicTacToePlugin {
.run_if(any_component_added::<Player>), // Wait until client replicates players before starting the game.
(
Self::handle_interactions.run_if(local_player_turn),
Self::spawn_symbols.run_if(has_authority),
Self::spawn_symbols.run_if(server_or_singleplayer),
Self::init_symbols,
Self::advance_turn.run_if(any_component_added::<CellIndex>),
Self::show_turn_symbol.run_if(resource_changed::<CurrentTurn>),
Expand Down

0 comments on commit e581038

Please sign in to comment.