From b4595bc6fe9ec3697a4128d43325aaf094256969 Mon Sep 17 00:00:00 2001 From: Dalton-V Date: Wed, 15 Apr 2026 07:44:32 -0500 Subject: [PATCH] Add start menu check if flee fails to detect overworld transition --- .../Source/PokemonFRLG/PokemonFRLG_Navigation.cpp | 10 +++++----- .../Programs/PokemonFRLG_StartMenuNavigation.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp b/SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp index 03813eeda..5c9090613 100644 --- a/SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp +++ b/SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp @@ -464,11 +464,11 @@ void flee_battle(ConsoleHandle& console, ProControllerContext& context){ if (ret3 == 0){ console.log("Successfully fled the battle."); }else{ - OperationFailedException::fire( - ErrorReport::SEND_ERROR_REPORT, - "flee_battle(): Unable to flee from battle.", - console - ); + console.log("flee_battle(): failed to detect transition to overworld. Attempting to open start menu to verify successful flee.."); + + open_start_menu(console, context); + close_start_menu(console, context); + context.wait_for_all_requests(); } } diff --git a/SerialPrograms/Source/PokemonFRLG/Programs/PokemonFRLG_StartMenuNavigation.h b/SerialPrograms/Source/PokemonFRLG/Programs/PokemonFRLG_StartMenuNavigation.h index 581763a3f..885a62f92 100644 --- a/SerialPrograms/Source/PokemonFRLG/Programs/PokemonFRLG_StartMenuNavigation.h +++ b/SerialPrograms/Source/PokemonFRLG/Programs/PokemonFRLG_StartMenuNavigation.h @@ -24,7 +24,7 @@ using ProControllerContext = ControllerContext; namespace PokemonFRLG { -// Open the start menu from the overworld +// Open the start menu from the overworld. Throws OperationFailedException if it fails to open the menu after several attempts. void open_start_menu(ConsoleHandle& console, ProControllerContext& context); // Close the start menu to return to the overworld