From a8f533da4746c70c062933f45d95a32cf3fdbd5f Mon Sep 17 00:00:00 2001 From: jugeeya Date: Thu, 3 Aug 2023 18:13:02 -0700 Subject: [PATCH] Fix standby on Ryujinx; fix playback when no slot is selected (#560) --- src/training/input_record.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/training/input_record.rs b/src/training/input_record.rs index 4b27e22..63df613 100644 --- a/src/training/input_record.rs +++ b/src/training/input_record.rs @@ -271,7 +271,11 @@ pub unsafe fn playback() { println!("Tried to playback during lockout!"); return; } - CURRENT_PLAYBACK_SLOT = MENU.playback_slot.get_random().into_idx().unwrap(); + if MENU.playback_slot.is_empty() { + println!("Tried to playback without a slot selected!"); + return; + } + CURRENT_PLAYBACK_SLOT = MENU.playback_slot.get_random().into_idx().unwrap_or(0); INPUT_RECORD = Playback; POSSESSION = Player; INPUT_RECORD_FRAME = 0; @@ -317,7 +321,9 @@ pub unsafe fn is_end_standby() -> bool { let clamped_rstick_y = ((first_frame_input.rstick_y as f32) * STICK_CLAMP_MULTIPLIER).clamp(-1.0, 1.0); - let buttons_pressed = !first_frame_input.buttons.is_empty(); + // No buttons pressed or just flick jump-- if they really did a stick jump, we'd have lstick movement as well + let buttons_pressed = + !(first_frame_input.buttons.is_empty() || first_frame_input.buttons == Buttons::FLICK_JUMP); let lstick_movement = clamped_lstick_x.abs() >= STICK_NEUTRAL || clamped_lstick_y.abs() >= STICK_NEUTRAL; let rstick_movement =