diff --git a/src/func.rs b/src/func.rs index a192593..4b1049e 100644 --- a/src/func.rs +++ b/src/func.rs @@ -85,6 +85,7 @@ fn keyboard(enigo: &mut Enigo, rng: &mut rand::rngs::ThreadRng) { } } +#[cfg(feature = "advanced")] fn gamepad(gamepad: &mut GamepadInjector, rng: &mut rand::rngs::ThreadRng) { let lists: Vec<(Vec<(&str, usize)>, usize)> = vec![ (GAMEPAD_BUTTONS.to_vec(), 5), diff --git a/src/main.rs b/src/main.rs index a3d8db1..a877550 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,11 +35,13 @@ async fn main() { let mut gamepad = GamepadInjector::new(); #[cfg(feature = "advanced")] - loop { - main_logic_adv(&options, &mut tts, &mut enigo).await; + { + loop { + main_logic_adv(&options, &mut tts, &mut enigo, &mut gamepad).await; + } } - #[not(cfg(feature = "advanced"))] + #[allow(unreachable_code)] loop { - main_logic(&options, &mut tts, &mut enigo, &mut gamepad).await; + main_logic(&options, &mut tts, &mut enigo).await; } } \ No newline at end of file