UnownHash / Golbat

The Unlicense
36 stars 19 forks source link

feat: use `min` & `max` in pokemon search api #208

Closed TurtIeSocks closed 8 months ago

TurtIeSocks commented 8 months ago

This makes use of the previously ignored min and max location arguments.

It does a one time haversine comparison between the two points sent in the API request to ensure the distance is shorter than the new config value tuning.max_pokemon_distance.

After the check, it uses the Pythagorean theorem to calculate the box-dist between the two points for comparison with the Pokemon's distance from the center point.

jfberry commented 8 months ago

This should have a maximum distance that golbat will accept from client defined in config with reasonable default (like max Pokemon)