Fix not offsetting party member index for move learning when fusing

pull/16/head
Flashfyre 2024-02-28 22:29:21 -05:00
parent 59fb3fa5db
commit cf7224365a
1 changed files with 4 additions and 1 deletions

View File

@ -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<boolean>[] = [];