Skip to content

Commit eec9a7d

Browse files
committed
Fix the regi light reset.
1 parent fdde248 commit eec9a7d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

SerialPrograms/Source/CommonTools/VisualDetector.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class StaticScreenDetector{
1919
public:
2020
virtual ~StaticScreenDetector() = default;
2121
virtual void make_overlays(VideoOverlaySet& items) const = 0;
22+
23+
// This is not const so that detectors can save/cache state.
2224
virtual bool detect(const ImageViewRGB32& screen) = 0;
2325
};
2426

SerialPrograms/Source/PokemonSwSh/Programs/ShinyHuntAutonomous/PokemonSwSh_ShinyHuntAutonomous-Regi.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
78
#include "CommonFramework/Notifications/ProgramNotifications.h"
89
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
910
#include "NintendoSwitch/NintendoSwitch_Settings.h"
@@ -142,7 +143,9 @@ void ShinyHuntAutonomousRegi::program(SingleSwitchProgramEnvironment& env, ProCo
142143
if (result.shiny_type == ShinyType::UNKNOWN){
143144
stats.add_error();
144145
pbf_mash_button(context, BUTTON_B, TICKS_PER_SECOND);
145-
run_away(env.console, context, EXIT_BATTLE_TIMEOUT0);
146+
try{
147+
run_away(env.console, context, EXIT_BATTLE_TIMEOUT0);
148+
}catch (OperationFailedException&){}
146149
error = true;
147150
continue;
148151
}

0 commit comments

Comments
 (0)