Skip to content

Commit 12eee1e

Browse files
author
Gin
committed
fix minor issues
1 parent 687ee0e commit 12eee1e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_AutoFossil.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void AutoFossil::revive_one_fossil(SingleSwitchProgramEnvironment& env, ProContr
181181

182182
int ret = wait_until(
183183
env.console, context,
184-
10000ms,
184+
10s,
185185
{
186186
buttonA_watcher,
187187
selection_arrow_watcher,
@@ -233,7 +233,7 @@ void AutoFossil::revive_one_fossil(SingleSwitchProgramEnvironment& env, ProContr
233233
env.update_stats();
234234
OperationFailedException::fire(
235235
ErrorReport::SEND_ERROR_REPORT,
236-
"revive_one_fossil(): No recognized state after 60 seconds.",
236+
"revive_one_fossil(): No recognized state after 10 seconds.",
237237
env.console
238238
);
239239
}
@@ -256,7 +256,15 @@ bool AutoFossil::check_fossils_in_one_box(
256256
box_detector.move_cursor(env.program_info(), env.console, context, box_row, box_col);
257257

258258
info_watcher.reset_state();
259-
wait_until(env.console, context, WallClock::max(), {info_watcher});
259+
const int ret = wait_until(env.console, context, std::chrono::seconds(10), {info_watcher});
260+
if (ret < 0) {
261+
OperationFailedException::fire(
262+
ErrorReport::SEND_ERROR_REPORT,
263+
"Failed to detect box info at cell idx " + std::to_string(i) + " after 30 seconds",
264+
env.console
265+
);
266+
}
267+
260268

261269
std::ostringstream os;
262270
os << num_checked_fossils_in_previous_boxes + i + 1 << "/" << NUM_FOSSILS << ": " << info_watcher.info_str();

0 commit comments

Comments
 (0)