From 8f55245a3862838afa0c5f38db5b3e86e9cbc911 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 30 Jan 2024 13:51:00 -0500 Subject: [PATCH] Fix evolution screen not preserving form index --- src/pokemon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pokemon.ts b/src/pokemon.ts index 2f3f84071..6fbb38484 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -1882,7 +1882,7 @@ export class PlayerPokemon extends Pokemon { getPossibleEvolution(evolution: SpeciesEvolution): Promise { return new Promise(resolve => { 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); ret.loadAssets().then(() => resolve(ret)); });