Armax / Pokemon-GO-node-api

Pokemon GO api node.js library
MIT License
875 stars 198 forks source link

Get rid of NearbyPokemon[0].DistanceMeters.toString() #224

Closed GcodeS closed 7 years ago

GcodeS commented 7 years ago

NearbyPokemon[0].DistanceMeters.toString() is now returning to null. It breaks the code.

andnp commented 7 years ago

You might also create an issue in the s2-geometry repository to add this functionality to their API.

GcodeS commented 7 years ago

@andnp it isn't their fault. Pokemon Go is now returning every distance null, so toString() cannot work properly.

RedSparr0w commented 7 years ago

incase it starts working again ive just changed my code to:

console.log(pokemon.name + ' spotted ' + ( hb.cells[i].NearbyPokemon[n].DistanceMeters ?  hb.cells[i].NearbyPokemon[n].DistanceMeters.toString()+' meters away' : 'nearby' ));

which would output Zubat spotted nearby if DistanceMeters==null

fr0th commented 7 years ago

+1