From 09f530207865916c991e9c53ef86a693f3f0b7b5 Mon Sep 17 00:00:00 2001 From: kichithewolf Date: Thu, 5 Mar 2026 19:44:44 -0500 Subject: [PATCH] Update PokemonFRLG_Navigation.cpp --- .../Source/PokemonFRLG/PokemonFRLG_Navigation.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp b/SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp index 59ebf9483b..31c885597d 100644 --- a/SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp +++ b/SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp @@ -317,12 +317,15 @@ void flee_battle(ConsoleHandle& console, ProControllerContext& context){ ); } - pbf_press_button(context, BUTTON_A, 320ms, 320ms); BlackScreenOverWatcher battle_over(COLOR_RED, {0.282, 0.064, 0.448, 0.871}); - int ret3 = wait_until( + int ret3 = run_until( console, context, - std::chrono::seconds(5), - {{battle_over}} + [](ProControllerContext& context) { + pbf_press_button(context, BUTTON_A, 320ms, 640ms); + pbf_wait(context, 5000ms); + context.wait_for_all_requests(); + }, + { battle_over } ); if (ret3 == 0){ console.log("Successfully fled the battle.");