Skip to content

Commit aac2ec4

Browse files
committed
Fix Pokemon center navigation. (credit jw)
1 parent 65b1fd6 commit aac2ec4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SerialPrograms/Source/PokemonSV/Programs/PokemonSV_WorldNavigation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ bool detect_closest_pokecenter_and_move_map_cursor_there(
264264
}
265265

266266
// Convert the vector from center to the PokeCenter icon into a left joystick movement
267-
const double dif_x = closest_icon_x - center_x;
268-
const double dif_y = closest_icon_y - center_y;
267+
const double dif_x = (closest_icon_x - center_x) * 1920/ screen_width;
268+
const double dif_y = (closest_icon_y - center_y) * 1080/ screen_height;
269269
const double magnitude = std::max(std::sqrt(max_dist), 1.0);
270270
const double push_x = dif_x * 64 / magnitude, push_y = dif_y * 64 / magnitude;
271271

0 commit comments

Comments
 (0)