diff --git a/SerialPrograms/Source/PokemonSV/Programs/PokemonSV_Navigation.cpp b/SerialPrograms/Source/PokemonSV/Programs/PokemonSV_Navigation.cpp index dcdb4791f..3a953daae 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/PokemonSV_Navigation.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/PokemonSV_Navigation.cpp @@ -607,7 +607,7 @@ bool fly_to_visible_closest_pokecenter_cur_zoom_level( void fly_to_closest_pokecenter_on_map(const ProgramInfo& info, ConsoleHandle& console, BotBaseContext& context){ - const int max_try_count = 17; + const int MAX_TRY_COUNT = 17; int try_count = 0; // Part 1: Tries to detect a pokecenter that is very close to the player // Zoom in one level onto the map. @@ -615,7 +615,7 @@ void fly_to_closest_pokecenter_on_map(const ProgramInfo& info, ConsoleHandle& co // detect it. So we zoom in as much as we can to prevent any icon overlap. // failures to fly to pokecenter are often when the Switch lags. from my testing, a 1.4-1.5 adjustment factor seems to work - const std::array adjustment_table = {1, 1.4, 1, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 0.9, 0.8, 1.4}; // {1, 1.4, 1.5}; + const std::array adjustment_table = {1, 1.4, 1, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 0.9, 0.8, 1.4}; // {1, 1.4, 1.5}; while(true){ try { @@ -629,10 +629,9 @@ void fly_to_closest_pokecenter_on_map(const ProgramInfo& info, ConsoleHandle& co // no visible pokecenters at this zoom level. Move on to part 2. break; - }catch (OperationFailedException& e){ // pokecenter was detected, but failed to fly there - (void) e; + }catch (OperationFailedException&){ // pokecenter was detected, but failed to fly there try_count++; - if (try_count >= max_try_count){ + if (try_count >= MAX_TRY_COUNT){ throw OperationFailedException( ErrorReport::SEND_ERROR_REPORT, console, "fly_to_closest_pokecenter_on_map(): At min warpable map level, pokecenter was detected, but failed to fly there.", @@ -682,10 +681,9 @@ void fly_to_closest_pokecenter_on_map(const ProgramInfo& info, ConsoleHandle& co true ); } - }catch (OperationFailedException& e){ // pokecenter was detected, but failed to fly there - (void) e; + }catch (OperationFailedException&){ // pokecenter was detected, but failed to fly there try_count++; - if (try_count >= max_try_count){ + if (try_count >= MAX_TRY_COUNT){ throw OperationFailedException( ErrorReport::SEND_ERROR_REPORT, console, "fly_to_closest_pokecenter_on_map(): At max warpable map level, pokecenter was detected, but failed to fly there.",