Fix evolution screen not preserving form index
parent
9633897a27
commit
8f55245a38
|
@ -1882,7 +1882,7 @@ export class PlayerPokemon extends Pokemon {
|
||||||
getPossibleEvolution(evolution: SpeciesEvolution): Promise<Pokemon> {
|
getPossibleEvolution(evolution: SpeciesEvolution): Promise<Pokemon> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const species = getPokemonSpecies(evolution.speciesId);
|
const species = getPokemonSpecies(evolution.speciesId);
|
||||||
const formIndex = Math.max(this.species.forms.findIndex(f => f.formKey === evolution.evoFormKey), 0);
|
const formIndex = evolution.evoFormKey !== null ? Math.max(this.species.forms.findIndex(f => f.formKey === evolution.evoFormKey), 0) : this.formIndex;
|
||||||
const ret = this.scene.addPlayerPokemon(species, this.level, this.abilityIndex, formIndex, this.gender, this.shiny, this.ivs, this.nature, this);
|
const ret = this.scene.addPlayerPokemon(species, this.level, this.abilityIndex, formIndex, this.gender, this.shiny, this.ivs, this.nature, this);
|
||||||
ret.loadAssets().then(() => resolve(ret));
|
ret.loadAssets().then(() => resolve(ret));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue