Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EvolvePokemon : error regarding cp_multiplier #254

Closed
litil opened this issue Aug 25, 2016 · 2 comments
Closed

EvolvePokemon : error regarding cp_multiplier #254

litil opened this issue Aug 25, 2016 · 2 comments

Comments

@litil
Copy link

litil commented Aug 25, 2016

I have an issue with the EvolvePokemon method. When I tried to evolve a pokemon, I had an error regarding the id field, I fixed it thanks to the comment from in this issue : #194 .

Now, I have the same kind of error, but this time regarding the cp_multiplier :
Error: Illegal wire type for field Message.Field .ResponseEnvelop.Pokemon.cp_multiplier: 5 (1 expected)

I tried to replace int32 cp_multiplier with float cp_multiplier but I had "Illegal buffer" error.

Any idea? thanks

@ameyer
Copy link

ameyer commented Aug 27, 2016

Here is the proto I have been using.

proto file

And the function I use:

function evolve(pokemon){
    var id  = pokemon.id;
    var cp = pokemon.cp;
    var pokemon_id = pokemon.pokemon_id;

    pokeAPI.EvolvePokemon(id, function(err, result){
        if (err){
            printError("evolve",err);
        }else{
            if(result.Result ==  1){
                var pokemon = result.EvolvedPokemon

                console.log(chalk.blue("\tevolved to a "+monsters[pokemon.pokemon_type].name+" with the  CP of "+pokemon.cp));
            }else{
                console.log(result);
            }
        }
    });
}

@litil
Copy link
Author

litil commented Aug 30, 2016

Thanks a lot @ameyer with this proto file, the evolve function works!

@litil litil closed this as completed Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants