Closed rrcampbell-exe closed 3 years ago
Rather than asking if pokeInfo.pokeAttackPower
was equal to null
, I instead asked if data.power
was true. If true, then pokeInfo.pokeAttackPower = data.power
. If data.power
was false, then rerun pokeMoveFetch(pokeInfo.pokeName)
.
Description
Currently, when a pokémon winds up with an attack power of
null
, pokémon choice function is run again from the very top. This causes a slowdown in the retrieval of pokémon data.Possible Solutions
Un-nesting fetch calls to Poké API and making data available across functions would mean only the move needs to be chosen again, not the whole pokémon.
Prospective Future Issue
Using the solution above would create scenarios where pokémon with move power values of
null
for all moves end up in an endless loop, searching for a move with power associated with it. For example, Ditto only uses transform.