pperle / PoGoIV_xposed

Xposed module that displays pokémon IV's
MIT License
42 stars 14 forks source link

Fixed wrong level being returned in some cases #6

Closed MaT-PT closed 8 years ago

MaT-PT commented 8 years ago

Current implementation compares Pokémon CpM with values from the table using a threshold of 0.01, but this is too high since some CpM values can be very close to each other, with a difference as low as 0.0028 for the higher levels. This results in wrong level values being returned in some cases (mainly after level 11, where the delta between consecutive CpM values starts dropping below 0.01). For instance, a level 40 Pokémon (CpM 0.7903) would be marked as level 38.5 (CpM 0.7818), since |0.7903-0.7818| < 0.01.

This PR lowers the threshold to 0.0001 in order to fix this issue.