-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update Autostory tools. added UnexpectedBattleException. #493
Conversation
namespace PokemonAutomation{ | ||
|
||
|
||
UnexpectedBattleException::UnexpectedBattleException(ErrorReport error_report, Logger& logger, std::string message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this, there will be 4 exception classes with near identical implementations. I'll probably revisit this in future to try to merge away some of this duplicate code.
return fly_to_overworld_from_map(info, console, context, true); | ||
|
||
}catch (UnexpectedBattleException& e){ | ||
(void) e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you omit the parameter name in the catch declaration, you don't need to do this.
}catch (UnexpectedBattleException&){
open_map_from_overworld(info, console, context); | ||
fly_to_closest_pokecenter_on_map(info, console, context); | ||
}catch (UnexpectedBattleException& e){ | ||
(void) e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
throw OperationFailedException( | ||
ErrorReport::SEND_ERROR_REPORT, console, | ||
"leave_phone_to_overworld(): Unknown state after 10 button Y presses.", | ||
true | ||
); | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how these random trailing spaces get added.
added UnexpectedBattleException.
added battle detection for functions that need to detect overworld.
Updated DestionationMarker detector so that it can be detected within the minimap (where it alternates between orange and yellow).
I also added handle_when_stationary_in_overworld(). It's commented out for now, since it requires
StationaryOverworldWatcher
, which hasn't been merged yet. I'll submit this in another PR later.