From cf7224365aa0ddaf266da8964ec055d981b0fcc7 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Wed, 28 Feb 2024 22:29:21 -0500 Subject: [PATCH] Fix not offsetting party member index for move learning when fusing --- src/pokemon.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pokemon.ts b/src/pokemon.ts index 8b200e7c764..a5462979a17 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -2065,9 +2065,12 @@ export class PlayerPokemon extends Pokemon { this.generateName(); this.calculateStats(); this.generateCompatibleTms(); - pokemon.getMoveset(true).map(m => this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.scene.getParty().indexOf(this), m.getMove().id))); this.updateInfo(true).then(() => { const fusedPartyMemberIndex = this.scene.getParty().indexOf(pokemon); + let partyMemberIndex = this.scene.getParty().indexOf(this); + if (partyMemberIndex > fusedPartyMemberIndex) + partyMemberIndex--; + pokemon.getMoveset(true).map(m => this.scene.unshiftPhase(new LearnMovePhase(this.scene, partyMemberIndex, m.getMove().id))); const fusedPartyMemberHeldModifiers = this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier && (m as PokemonHeldItemModifier).pokemonId === pokemon.id, true) as PokemonHeldItemModifier[]; const transferModifiers: Promise[] = [];