[Bug] gym.getGuardPokemonCp always return 0
Description: The method api.getMapObjects().getGyms() returns 0 for every getGuardPokemonCp()
Are there any way to fetch gym data from gymId?
Unfortunately I can't look at it now due to the api change but getDefendingPokemon() has been working fine.
Something like:
for (Gym gym : go.getMap().getGyms()) {
Thread.sleep(1000);
System.out.println(gym.getDescription()+" @ "+gym.getLatitude()+", "+gym.getLongitude() + " - "+gym.getOwnedByTeam());
System.out.println("In range: "+gym.inRange()+" Enabled: "+gym.getEnabled());
List<PokemonData> dataList = gym.getDefendingPokemon();
for(PokemonData d : dataList)
{
Thread.sleep(250);
System.out.println(" "+d.getCp()+" - "+d.getPokemonId()+ " - "+d.getOwnerName());
}
}
This will get all gyms in range and print out various information about them.
The only annoying thing I've run into is that inRange() can be true but the server doesn't actually consider you to be in range. This happens quite frequently in my town park where there are three gyms within a half mile.
You can use a GetGymDetails request too if you have a gymId, care that you arent spamming request tho. Its was working great in the past and Niantic didnt change this side of api so yeah, should come from rate limit.