diff --git a/src/game.rs b/src/game.rs index 4ee976d..5e859c3 100644 --- a/src/game.rs +++ b/src/game.rs @@ -28,9 +28,9 @@ impl Plugin for GamePlugin { .add_systems( PreUpdate, ( - asserts::, - asserts::, - ), + asserts::.run_if(in_state(DisplayState::Display2d)), + asserts::.run_if(in_state(DisplayState::Display3d)), + ).run_if(in_state(GameState::Play)), ) .add_systems( PostUpdate, @@ -489,6 +489,7 @@ fn capture_piece(mut events: Query<&mut Visibility, Added>) { fn asserts( selected_pieces: Query, With, With)>, selected_tiles: Query, With, With)>, + cameras: Query, With)>, ) { if selected_pieces.iter().len() > 2 { selected_pieces.iter().for_each(|e| { @@ -505,4 +506,7 @@ fn asserts( selected_tiles.iter().len() ); } -} + if cameras.iter().len() != 1 { + panic!("There should be 2 cameras in this state, but there is only {}", cameras.iter().len()); + } +} \ No newline at end of file