thestuckster / pokemonBotDown

0 stars 0 forks source link

Player name assertion will not always be true #5

Open ghost opened 8 years ago

ghost commented 8 years ago

Unfortunately, I am finding that this assertion will also fail if the opponent leaves :( https://github.com/thestuckster/pokemonBotDown/blob/master/client2/pokemonClient.js#L87

It looks like if the opponent leaves args[1] will be undefined.

SpenceSellers commented 8 years ago

I actually like seeing all of these asserts failing. These are all things that we would figure out after eight hours of debugging why PokemonTrainer.name becomes undefined at random times...

SpenceSellers commented 8 years ago

That is kind of bizzare though. Why would your opponent forfeiting a match cause you to have no name anymore?

Luckily it can kind of just be ignored, the opponent forfeiting causes a Win message anyway.

ghost commented 8 years ago

yeah. I agree that the assertions are a good thing 👍