diff --git a/SerialPrograms/Source/PokemonLZA/Programs/PokemonLZA_StallBuyer.cpp b/SerialPrograms/Source/PokemonLZA/Programs/PokemonLZA_StallBuyer.cpp index 7674cc2b2a..a57dfb08e9 100644 --- a/SerialPrograms/Source/PokemonLZA/Programs/PokemonLZA_StallBuyer.cpp +++ b/SerialPrograms/Source/PokemonLZA/Programs/PokemonLZA_StallBuyer.cpp @@ -18,6 +18,7 @@ #include "PokemonLZA/Inference/PokemonLZA_SelectionArrowDetector.h" #include "PokemonLZA/Inference/PokemonLZA_DialogDetector.h" #include "PokemonLZA_StallBuyer.h" +#include namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -122,7 +123,8 @@ int detect_stall_amount_item(SingleSwitchProgramEnvironment& env, StallBuyer_Des bool is_five_item_stall = five_item_stall_detector.detect(snapshot); bool is_two_item_stall = two_item_stall_detector.detect(snapshot); - int count = is_seven_item_stall + is_six_item_stall + is_five_item_stall + is_two_item_stall; + std::array array = {is_seven_item_stall, is_six_item_stall, is_five_item_stall, is_two_item_stall}; + auto count = std::count(array.begin(), array.end(), true); if (count == 1){ // Exactly one kind of stall detected if (is_seven_item_stall){