From 78a548dd637ea662e218f0a15544ec21b0739eb7 Mon Sep 17 00:00:00 2001 From: Mysticial Date: Thu, 21 Sep 2023 18:25:35 -0700 Subject: [PATCH] Fix platform reset to recover from being stuck. --- .../ShinyHunting/PokemonSV_ShinyHunt-AreaZeroPlatform.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/ShinyHunting/PokemonSV_ShinyHunt-AreaZeroPlatform.cpp b/SerialPrograms/Source/PokemonSV/Programs/ShinyHunting/PokemonSV_ShinyHunt-AreaZeroPlatform.cpp index 5b5dfa32f..edd300b3d 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/ShinyHunting/PokemonSV_ShinyHunt-AreaZeroPlatform.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/ShinyHunting/PokemonSV_ShinyHunt-AreaZeroPlatform.cpp @@ -404,7 +404,12 @@ void ShinyHuntAreaZeroPlatform::run_state(SingleSwitchProgramEnvironment& env, B return; case Location::AREA_ZERO: console.log("Executing: Traversal..."); - run_traversal(context); + try{ + run_traversal(context); + }catch (OperationFailedException&){ + m_pending_platform_reset = true; + throw; + } m_encounter_tracker->reset_rate_tracker_start_time(); m_consecutive_failures = 0; return;