Skip to content

Commit ec43d09

Browse files
committed
Fix BDSP EndBattleDetector.
1 parent 69db5bc commit ec43d09

6 files changed

Lines changed: 14 additions & 20 deletions

File tree

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace PokemonAutomation{
3939
#endif
4040

4141
#ifndef PA_VERSION_PATCH
42-
#define PA_VERSION_PATCH 1
42+
#define PA_VERSION_PATCH 2
4343
#endif
4444

4545
const bool IS_BETA_VERSION = PA_IS_BETA;

SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,14 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope&
334334
VideoOverlaySet overlays(overlay);
335335

336336

337+
// OperationFailedException::fire(ErrorReport::SEND_ERROR_REPORT, "test", console);
338+
339+
#if 0
337340
auto snapshot = feed.snapshot();
338341
YCommMenuDetector detector(true);
339342
detector.make_overlays(overlays);
340343
cout << detector.detect(snapshot) << endl;
344+
#endif
341345

342346
#if 0
343347
SelectionArrowFinder arrow(overlay, {0.462377, 0.332039, 0.388222, 0.640777});

SerialPrograms/Source/PokemonBDSP/Inference/Battles/PokemonBDSP_EndBattleDetector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class EndBattleWatcher : public BlackScreenOverWatcher{
4545
Color color = COLOR_RED
4646
)
4747
: BlackScreenOverWatcher(
48-
color, box, 100, 10, std::chrono::milliseconds(1000)
48+
color, box, 100, 10, std::chrono::milliseconds(500)
4949
)
5050
{}
5151

SerialPrograms/Source/PokemonBDSP/Programs/Farming/PokemonBDSP_DoublesLeveling.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,9 @@ bool DoublesLeveling::battle(SingleSwitchProgramEnvironment& env, ProControllerC
139139
pbf_mash_button(context, BUTTON_B, 2000ms);
140140
return false;
141141
default:
142-
env.log("Timed out.", COLOR_RED);
143142
stats.add_error();
144-
OperationFailedException::fire(
145-
ErrorReport::SEND_ERROR_REPORT,
146-
"Timed out after 2 minutes.",
147-
env.console
148-
);
143+
env.log("Timed out after 2 minutes. Assume battle ended.", COLOR_RED);
144+
return false;
149145
}
150146
}
151147

SerialPrograms/Source/PokemonBDSP/Programs/Farming/PokemonBDSP_MoneyFarmerRoute210.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ bool MoneyFarmerRoute210::battle(SingleSwitchProgramEnvironment& env, ProControl
185185
{learn_move},
186186
}
187187
);
188-
189-
188+
189+
190190
switch (ret){
191191
case 0:
192192
env.log("Battle menu detected!", COLOR_BLUE);
@@ -255,11 +255,8 @@ bool MoneyFarmerRoute210::battle(SingleSwitchProgramEnvironment& env, ProControl
255255
return true;
256256
default:
257257
stats.m_errors++;
258-
OperationFailedException::fire(
259-
ErrorReport::SEND_ERROR_REPORT,
260-
"Timed out after 2 minutes.",
261-
env.console
262-
);
258+
env.log("Timed out after 2 minutes. Assume battle ended.", COLOR_RED);
259+
return false;
263260
}
264261
}
265262

SerialPrograms/Source/PokemonBDSP/Programs/Farming/PokemonBDSP_MoneyFarmerRoute212.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,8 @@ bool MoneyFarmerRoute212::battle(SingleSwitchProgramEnvironment& env, ProControl
195195

196196
default:
197197
stats.m_errors++;
198-
OperationFailedException::fire(
199-
ErrorReport::SEND_ERROR_REPORT,
200-
"Timed out after 30 seconds.",
201-
env.console
202-
);
198+
env.log("Timed out after 30 seconds. Assume battle ended.", COLOR_RED);
199+
return false;
203200
}
204201
}
205202

0 commit comments

Comments
 (0)