Skip to content

Commit 235e7e8

Browse files
committed
Update PokemonFRLG_GiftReset.cpp
1 parent d8d5e00 commit 235e7e8

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_GiftReset.cpp

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,31 +100,33 @@ void GiftReset::obtain_pokemon(SingleSwitchProgramEnvironment& env, ProControlle
100100
*/
101101

102102
env.log("Obtaining Pokemon.");
103-
AdvanceWhiteDialogWatcher adv_white_start(COLOR_RED);
104-
105-
int rets = run_until<ProControllerContext>(
106-
env.console, context,
107-
[](ProControllerContext& context){
108-
for (int i = 0; i < 10; i++){
109-
pbf_press_button(context, BUTTON_A, 320ms, 640ms);
110-
pbf_wait(context, 2000ms);
111-
context.wait_for_all_requests();
112-
}
113-
},
114-
{ adv_white_start }
115-
);
116-
context.wait_for_all_requests();
117-
if (rets < 0){
118-
env.update_stats();
119-
env.log("obtain_pokemon(): Unable to start starter dialog after 10 attempts.", COLOR_RED);
103+
if (TARGET == Target::starters) {
104+
AdvanceWhiteDialogWatcher adv_white_start(COLOR_RED);
105+
int rets = run_until<ProControllerContext>(
106+
env.console, context,
107+
[](ProControllerContext& context) {
108+
for (int i = 0; i < 10; i++) {
109+
pbf_press_button(context, BUTTON_A, 320ms, 640ms);
110+
pbf_wait(context, 2000ms);
111+
context.wait_for_all_requests();
112+
}
113+
},
114+
{ adv_white_start }
115+
);
116+
context.wait_for_all_requests();
117+
if (rets < 0) {
118+
env.update_stats();
119+
env.log("obtain_pokemon(): Unable to start starter dialog after 10 attempts.", COLOR_RED);
120120
OperationFailedException::fire(
121121
ErrorReport::SEND_ERROR_REPORT,
122122
"obtain_pokemon(): Unable to start starter dialog after 10 attempts.",
123123
env.console
124124
);
125+
}
126+
env.log("Initial A press completed.");
127+
} else {
128+
pbf_press_button(context, BUTTON_A, 320ms, 640ms);
125129
}
126-
env.log("Initial A press completed.");
127-
128130
bool seen_selection_arrow = false;
129131
//bool seen_nickname_arrow = false;
130132
while (true){

0 commit comments

Comments
 (0)