Skip to content

Commit

Permalink
rename escape_stuck_on_wall
Browse files Browse the repository at this point in the history
  • Loading branch information
kichithewolf committed Mar 25, 2024
1 parent e2d4c0a commit af53e30
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ void fly_to_closest_pokecenter_on_map(const ProgramInfo& info, ConsoleHandle& co
}
}

void escape_stuck_on_wall(const ProgramInfo& info, ConsoleHandle& console, BotBaseContext& context) {
void jump_off_wall_until_map_open(const ProgramInfo& info, ConsoleHandle& console, BotBaseContext& context) {
for (auto i = 0; i < 3; i++) {
pbf_press_button(context, BUTTON_L, 50, 50);
pbf_press_button(context, BUTTON_B, 50, 50);
Expand All @@ -644,7 +644,7 @@ void escape_stuck_on_wall(const ProgramInfo& info, ConsoleHandle& console, BotBa
console.log("Could not escape wall.");
throw OperationFailedException(
ErrorReport::SEND_ERROR_REPORT, console,
"escape_stuck_on_wall(): Could not escape wall.",
"jump_off_wall_until_map_open(): Could not escape wall.",
true
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ void fly_to_closest_pokecenter_on_map(const ProgramInfo& info, ConsoleHandle& co

// Attempt to escape being stuck on a wall.
// Repeatedly center camera and try to backwards jump off.
void escape_stuck_on_wall(const ProgramInfo& info, ConsoleHandle& console, BotBaseContext& context);
// Finishes when map is successfully open.
void jump_off_wall_until_map_open(const ProgramInfo& info, ConsoleHandle& console, BotBaseContext& context);


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void return_to_plaza(const ProgramInfo& info, ConsoleHandle& console, BotBaseCon
open_map_from_overworld(info, console, context);
}
catch (...) {
escape_stuck_on_wall(info, console, context);
jump_off_wall_until_map_open(info, console, context);
}

//Move cursor to top left corner - even works when at Entrance fly point
Expand Down

0 comments on commit af53e30

Please sign in to comment.