Skip to content

Commit b484d02

Browse files
committed
Fix keyboard race-condition. Clear more PLA programs for SBB.
1 parent 5b07449 commit b484d02

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace PokemonAutomation{
2525
const bool IS_BETA_VERSION = true;
2626
const int PROGRAM_VERSION_MAJOR = 0;
2727
const int PROGRAM_VERSION_MINOR = 51;
28-
const int PROGRAM_VERSION_PATCH = 9;
28+
const int PROGRAM_VERSION_PATCH = 10;
2929

3030
const std::string PROGRAM_VERSION_BASE =
3131
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/CommonFramework/Panels/UI/PanelElements.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ CollapsibleGroupBox* make_panel_header(
121121
case PokemonAutomation::FasterIfTickPrecise::MUCH_FASTER:
122122
text = html_color_text(
123123
"(This program does not have any special controller requirements. "
124-
"However, it is strongly recommended to use a tick-precise controller as the program will run much faster.)",
124+
"However, it is strongly recommended to use a tick-precise controller as the program will run much faster and/or more reliably.)",
125125
COLOR_DARKGREEN
126126
);
127127
break;

SerialPrograms/Source/Controllers/KeyboardInput/GlobalQtKeyMap.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ void QtKeyMap::record(const QKeyEvent& event){
2222
m_map[native_key].insert(qkey);
2323
}
2424

25-
const std::set<Qt::Key>* QtKeyMap::get_QtKeys(uint32_t native_key) const{
25+
std::set<Qt::Key> QtKeyMap::get_QtKeys(uint32_t native_key) const{
2626
ReadSpinLock lg(m_lock);
2727
auto iter = m_map.find(native_key);
28-
if (iter == m_map.end()){
29-
return nullptr;
28+
if (iter != m_map.end()){
29+
return iter->second;
3030
}
31-
return &iter->second;
31+
return {};
3232
}
3333

3434

SerialPrograms/Source/Controllers/KeyboardInput/GlobalQtKeyMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class QtKeyMap{
2626

2727
void record(const QKeyEvent& event);
2828

29-
const std::set<Qt::Key>* get_QtKeys(uint32_t native_key) const;
29+
std::set<Qt::Key> get_QtKeys(uint32_t native_key) const;
3030

3131

3232
private:

SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ProController.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,8 @@ class ProController::KeyboardManager : public KeyboardInputController{
5353
ControllerDeltas deltas;
5454
const QtKeyMap& qkey_map = QtKeyMap::instance();
5555
for (uint32_t native_key : pressed_keys){
56-
const std::set<Qt::Key>* qkeys = qkey_map.get_QtKeys(native_key);
57-
if (qkeys == nullptr){
58-
continue;
59-
}
60-
for (Qt::Key qkey : *qkeys){
56+
std::set<Qt::Key> qkeys = qkey_map.get_QtKeys(native_key);
57+
for (Qt::Key qkey : qkeys){
6158
auto iter = m_mapping.find(qkey);
6259
if (iter != m_mapping.end()){
6360
deltas += iter->second;

SerialPrograms/Source/PokemonLA/Programs/Farming/PokemonLA_LeapGrinder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ LeapGrinder_Descriptor::LeapGrinder_Descriptor()
3636
"Shake trees and ores to grind tasks",
3737
FeedbackType::VIDEO_AUDIO,
3838
AllowCommandsWhenRunning::DISABLE_COMMANDS,
39-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
39+
{ControllerFeature::NintendoSwitch_ProController},
40+
FasterIfTickPrecise::NOT_FASTER
4041
)
4142
{}
4243
class LeapGrinder_Descriptor::Stats : public StatsTracker{

SerialPrograms/Source/PokemonLA/Programs/ShinyHunting/PokemonLA_BurmyFinder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ BurmyFinder_Descriptor::BurmyFinder_Descriptor()
4747
"Check nearby trees for a possible Shiny, Alpha or Alpha Shiny Burmy",
4848
FeedbackType::VIDEO_AUDIO,
4949
AllowCommandsWhenRunning::DISABLE_COMMANDS,
50-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
50+
{ControllerFeature::NintendoSwitch_ProController},
51+
FasterIfTickPrecise::FASTER
5152
)
5253
{}
5354
class BurmyFinder_Descriptor::Stats : public StatsTracker{

SerialPrograms/Source/PokemonLA/Programs/ShinyHunting/PokemonLA_PostMMOSpawnReset.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ PostMMOSpawnReset_Descriptor::PostMMOSpawnReset_Descriptor()
3131
"Constantly reset the spawn after MMO finishes.",
3232
FeedbackType::VIDEO_AUDIO,
3333
AllowCommandsWhenRunning::DISABLE_COMMANDS,
34-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
34+
{ControllerFeature::NintendoSwitch_ProController},
35+
FasterIfTickPrecise::NOT_FASTER
3536
)
3637
{}
3738
class PostMMOSpawnReset_Descriptor::Stats : public StatsTracker, public ShinyStatIncrementer{

SerialPrograms/Source/PokemonLA/Programs/ShinyHunting/PokemonLA_ShinyHunt-CustomPath.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ ShinyHuntCustomPath_Descriptor::ShinyHuntCustomPath_Descriptor()
3737
"Repeatedly travel on a custom path to shiny hunt " + STRING_POKEMON + " around it.",
3838
FeedbackType::VIDEO_AUDIO,
3939
AllowCommandsWhenRunning::DISABLE_COMMANDS,
40-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
40+
{ControllerFeature::NintendoSwitch_ProController,},
41+
FasterIfTickPrecise::FASTER
4142
)
4243
{}
4344
class ShinyHuntCustomPath_Descriptor::Stats : public StatsTracker, public ShinyStatIncrementer{

0 commit comments

Comments
 (0)