|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" |
| 8 | +#include "CommonFramework/VideoPipeline/VideoFeed.h" |
8 | 9 |
|
9 | 10 | #include "CommonFramework/Exceptions/OperationFailedException.h" |
10 | 11 | #include "CommonTools/Async/InferenceRoutines.h" |
@@ -106,6 +107,13 @@ void checkpoint_61( |
106 | 107 | ); |
107 | 108 |
|
108 | 109 | DirectionDetector direction; |
| 110 | + VideoSnapshot snapshot = env.console.video().snapshot(); |
| 111 | + double current_direction = direction.get_current_direction(env.console, snapshot); |
| 112 | + if (current_direction == -1){ // if unable to detect current direction, fly to neighbouring Pokecenter, then fly back. To hopefully clear any pokemon covering the Minimap. |
| 113 | + move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::KEEP_ZOOM, 0, 0, 0}); |
| 114 | + move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::KEEP_ZOOM, 0, 0, 0}); |
| 115 | + } |
| 116 | + |
109 | 117 | direction.change_direction(env.program_info(), env.console, context, 0.278620); |
110 | 118 | pbf_move_left_joystick(context, 128, 0, 400, 50); |
111 | 119 |
|
@@ -200,7 +208,7 @@ void checkpoint_62( |
200 | 208 | // lemon |
201 | 209 | pbf_press_dpad(context, DPAD_DOWN, 13, 20); |
202 | 210 | pbf_press_button(context, BUTTON_A, 50, 50); |
203 | | - clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD}); |
| 211 | + clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD}, false); |
204 | 212 |
|
205 | 213 |
|
206 | 214 | pbf_mash_button(context, BUTTON_A, 1000ms); |
|
0 commit comments