Skip to content

catchPokemon() always use razzberry item #279

@Lasek

Description

@Lasek

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions