Skip to content

Commit 98231ea

Browse files
author
Gin
committed
finish reviving fossil loop
1 parent 40b1768 commit 98231ea

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

SerialPrograms/Source/PokemonLZA/Programs/PokemonLZA_AutoFossil.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ void AutoFossil::program(SingleSwitchProgramEnvironment& env, ProControllerConte
7676
size_t num_fossils_to_revive = 3;
7777
for(size_t i = 0; i < num_fossils_to_revive; i++){
7878
revive_one_fossil(env, context);
79-
stats.fossils++;
80-
env.update_stats();
8179
std::ostringstream os;
82-
os << "Fossil " << i + 1 << "/" << num_fossils_to_revive;
80+
os << "Got Fossil " << i + 1 << "/" << num_fossils_to_revive;
8381
std::string log_str = os.str();
8482
env.log(log_str);
8583
env.console.overlay().add_log(log_str);
@@ -122,6 +120,12 @@ void AutoFossil::revive_one_fossil(SingleSwitchProgramEnvironment& env, ProContr
122120
switch (ret){
123121
case 0:
124122
env.log("Detected A button.");
123+
if (seen_selection_arrow){
124+
// we finish one round of fossil reviving
125+
stats.fossils++;
126+
env.update_stats();
127+
return;
128+
}
125129
// press A to start dialog with researcher Reg to start reviving a new fossil
126130
pbf_press_button(context, BUTTON_A, 80ms, 40ms);
127131
continue;

0 commit comments

Comments
 (0)