Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticial committed Jan 8, 2025
2 parents 22b6810 + 1cf993a commit e2dfa8d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ CramomaticRow::CramomaticRow(EditableTableOption& parent_table)
PA_ADD_OPTION(is_bonus);
PA_ADD_OPTION(priority);
}

CramomaticRow::CramomaticRow(EditableTableOption& parent_table, CramomaticBallType p_ball_type, bool p_is_bonus, uint16_t p_priority)
: CramomaticRow(parent_table)
{
ball_type.set(p_ball_type);
is_bonus = p_is_bonus;
priority.set(p_priority);
}

std::unique_ptr<EditableTableRow> CramomaticRow::clone() const{
std::unique_ptr<CramomaticRow> ret(new CramomaticRow(parent()));
ret->ball_type.set_value(ball_type.current_value());
Expand Down Expand Up @@ -79,7 +88,8 @@ std::vector<std::string> CramomaticTable::make_header() const{

std::vector<std::unique_ptr<EditableTableRow>> CramomaticTable::make_defaults(){
std::vector<std::unique_ptr<EditableTableRow>> ret;
ret.emplace_back(std::make_unique<CramomaticRow>(*this));
ret.emplace_back(std::make_unique<CramomaticRow>(*this, CramomaticBallType::Apricorn, true, 1));
ret.emplace_back(std::make_unique<CramomaticRow>(*this, CramomaticBallType::Apricorn, false, 0));
return ret;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct CramomaticSelection
class CramomaticRow : public EditableTableRow{
public:
CramomaticRow(EditableTableOption& parent_table);
CramomaticRow(EditableTableOption& parent_table, CramomaticBallType p_ball_type, bool p_is_bonus, uint16_t p_priority);
virtual std::unique_ptr<EditableTableRow> clone() const;

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ void CramomaticRNG::program(SingleSwitchProgramEnvironment& env, BotBaseContext&
}catch (OperationFailedException& e){
stats.errors++;
env.update_stats();
e.send_notification(env, NOTIFICATION_ERROR_RECOVERABLE);

apricorn_selection_errors++;
if (apricorn_selection_errors >= 3){
Expand All @@ -497,8 +496,7 @@ void CramomaticRNG::program(SingleSwitchProgramEnvironment& env, BotBaseContext&
"Could not detect the bag three times on a row."
);
}
VideoSnapshot screen = env.console.video().snapshot();
send_program_recoverable_error_notification(env, NOTIFICATION_ERROR_RECOVERABLE, "Could not detect the bag.", screen);
send_program_recoverable_error_notification(env, NOTIFICATION_ERROR_RECOVERABLE, e.message(), e.screenshot());
is_state_valid = false;
recover_from_wrong_state(env, context);
continue;
Expand Down

0 comments on commit e2dfa8d

Please sign in to comment.