PokeGOAPI-Java icon indicating copy to clipboard operation
PokeGOAPI-Java copied to clipboard

catchPokemon() always use razzberry item

Open Lasek opened this issue 10 years ago • 0 comments

Description: catchPokemon() always use razzberry item, even if I check that limit is 0

Steps to reproduce: pokemon.catchPokemon(ball, 3, 0);

Expected behavior: Max attemps = 3 Max allow razzberry = 0

Actual behavior: Max attemps = 0 Max allow razzberry = -1 //unlimited

Solution: CatchablePokemon.java:267

public CatchResult catchPokemon(Pokeball pokeball, int amount, int razberryLimit)
        throws LoginFailedException, RemoteServerException {
    return catchPokemon(1.0, 1.95 + Math.random() * 0.05,
            0.85 + Math.random() * 0.15, pokeball, razberryLimit);
}

change to:

public CatchResult catchPokemon(Pokeball pokeball, int amount, int razberryLimit)
        throws LoginFailedException, RemoteServerException {
    return catchPokemon(1.0, 1.95 + Math.random() * 0.05,
            0.85 + Math.random() * 0.15, pokeball, amount, razberryLimit);
}

Lasek avatar Jul 27 '16 12:07 Lasek