diff --git a/SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp b/SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp index fee5aa08bb..f3ea879cb1 100644 --- a/SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp +++ b/SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp @@ -193,7 +193,7 @@ bool operator<(const std::optional& lhs, const std::optional& } for (const BoxSortingSelection preference : *lhs->preferences){ - bool ret = true; + std::optional ret{}; switch(preference.sort_type){ // NOTE edit when adding new struct members case BoxSortingSortType::NationalDexNo: @@ -228,10 +228,13 @@ bool operator<(const std::optional& lhs, const std::optional& } break; } - if (preference.reverse){ - return !ret; - }else{ - return ret; + if (ret.has_value()){ + bool value = *ret; + if (preference.reverse){ + return !value; + }else{ + return value; + } } } diff --git a/SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp b/SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp index d4a2cacd55..4a1ac3655e 100644 --- a/SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp +++ b/SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp @@ -107,7 +107,6 @@ bool reset_game_from_home( "reset_game_from_home(): Right Joycon required.", stream ); - return false; } bool ok = true; ok &= reset_game_to_gamemenu(stream, context);