Skip to content

Commit e2dfa8d

Browse files
committed
2 parents 22b6810 + 1cf993a commit e2dfa8d

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

SerialPrograms/Source/PokemonSwSh/Options/PokemonSwSh_CramomaticTable.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ CramomaticRow::CramomaticRow(EditableTableOption& parent_table)
3636
PA_ADD_OPTION(is_bonus);
3737
PA_ADD_OPTION(priority);
3838
}
39+
40+
CramomaticRow::CramomaticRow(EditableTableOption& parent_table, CramomaticBallType p_ball_type, bool p_is_bonus, uint16_t p_priority)
41+
: CramomaticRow(parent_table)
42+
{
43+
ball_type.set(p_ball_type);
44+
is_bonus = p_is_bonus;
45+
priority.set(p_priority);
46+
}
47+
3948
std::unique_ptr<EditableTableRow> CramomaticRow::clone() const{
4049
std::unique_ptr<CramomaticRow> ret(new CramomaticRow(parent()));
4150
ret->ball_type.set_value(ball_type.current_value());
@@ -79,7 +88,8 @@ std::vector<std::string> CramomaticTable::make_header() const{
7988

8089
std::vector<std::unique_ptr<EditableTableRow>> CramomaticTable::make_defaults(){
8190
std::vector<std::unique_ptr<EditableTableRow>> ret;
82-
ret.emplace_back(std::make_unique<CramomaticRow>(*this));
91+
ret.emplace_back(std::make_unique<CramomaticRow>(*this, CramomaticBallType::Apricorn, true, 1));
92+
ret.emplace_back(std::make_unique<CramomaticRow>(*this, CramomaticBallType::Apricorn, false, 0));
8393
return ret;
8494
}
8595

SerialPrograms/Source/PokemonSwSh/Options/PokemonSwSh_CramomaticTable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ struct CramomaticSelection
3737
class CramomaticRow : public EditableTableRow{
3838
public:
3939
CramomaticRow(EditableTableOption& parent_table);
40+
CramomaticRow(EditableTableOption& parent_table, CramomaticBallType p_ball_type, bool p_is_bonus, uint16_t p_priority);
4041
virtual std::unique_ptr<EditableTableRow> clone() const;
4142

4243
public:

SerialPrograms/Source/PokemonSwSh/Programs/RNG/PokemonSwSh_CramomaticRNG.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ void CramomaticRNG::program(SingleSwitchProgramEnvironment& env, BotBaseContext&
488488
}catch (OperationFailedException& e){
489489
stats.errors++;
490490
env.update_stats();
491-
e.send_notification(env, NOTIFICATION_ERROR_RECOVERABLE);
492491

493492
apricorn_selection_errors++;
494493
if (apricorn_selection_errors >= 3){
@@ -497,8 +496,7 @@ void CramomaticRNG::program(SingleSwitchProgramEnvironment& env, BotBaseContext&
497496
"Could not detect the bag three times on a row."
498497
);
499498
}
500-
VideoSnapshot screen = env.console.video().snapshot();
501-
send_program_recoverable_error_notification(env, NOTIFICATION_ERROR_RECOVERABLE, "Could not detect the bag.", screen);
499+
send_program_recoverable_error_notification(env, NOTIFICATION_ERROR_RECOVERABLE, e.message(), e.screenshot());
502500
is_state_valid = false;
503501
recover_from_wrong_state(env, context);
504502
continue;

0 commit comments

Comments
 (0)