farkam135 / GoIV

https://www.reddit.com/r/goiv
Other
372 stars 141 forks source link

Fix evolution candy cost calculation #1058

Closed xZise closed 5 years ago

xZise commented 5 years ago

When calculating the candy cost for evolutions, it checks that the start pokemon is really before the end pokemon. But with the split of PokemonBase and Pokemon a typo crept in, which actually checks the devolutions of the start pokemon.

This rewrites it into a simpler function, we already go through the devolutions anyway, so just have one loop which goes from the end pokemon to every devolution pokemon. If the start pokemon wasn't seen until there are no devolutions anymore, it either means that start and end are the wrong way around or that both aren't related.