Skip to content

Commit 7446aed

Browse files
committed
fixed handling of no encounter for fishing and rocksmash
1 parent e91d06f commit 7446aed

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_RngNavigation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ namespace NintendoSwitch{
1717
using ProControllerContext = ControllerContext<ProController>;
1818
namespace PokemonFRLG{
1919

20+
21+
int watch_for_shiny_encounter(ConsoleHandle& console, ProControllerContext& context);
22+
2023
bool check_for_shiny(ConsoleHandle& console, ProControllerContext& context, PokemonFRLG_RngTarget TARGET);
2124

2225

SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_WildRng.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,19 @@ void WildRng::program(SingleSwitchProgramEnvironment& env, ProControllerContext&
914914
RNG_FILTERS.reset();
915915
RNG_CALIBRATION.reset();
916916

917-
bool shiny_found = check_for_shiny(env.console, context, TARGET);
917+
int ret = watch_for_shiny_encounter(env.console, context);
918+
if (ret < 1){
919+
if (TARGET == PokemonFRLG_RngTarget::fishing || TARGET == PokemonFRLG_RngTarget::rocksmash){
920+
env.log("No battle triggered. Resetting...");
921+
}else{
922+
OperationFailedException::fire(
923+
ErrorReport::SEND_ERROR_REPORT,
924+
"WildRng(): Failed to trigger battle",
925+
env.console
926+
);
927+
}
928+
}
929+
bool shiny_found = (ret == 1);
918930

919931
if (shiny_found){
920932
env.log("Shiny found!");

0 commit comments

Comments
 (0)