diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 7720d741b..bc5132307 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2473,7 +2473,7 @@ export class PlayerPokemon extends Pokemon { if (newEvolution.condition.predicate(this)) { const newPokemon = this.scene.addPlayerPokemon(this.species, this.level, this.abilityIndex, this.formIndex, undefined, this.shiny, this.variant, this.ivs, this.nature); newPokemon.natureOverride = this.natureOverride; - newPokemon.moveset = this.moveset.slice(); + newPokemon.moveset = this.copyMoveset(); newPokemon.luck = this.luck; newPokemon.fusionSpecies = this.fusionSpecies; @@ -2583,6 +2583,15 @@ export class PlayerPokemon extends Pokemon { this.updateFusionPalette(); }); } + + /** Returns a deep copy of this Pokemon's moveset array */ + copyMoveset(): PokemonMove[] { + let newMoveset = []; + this.moveset.forEach(move => + newMoveset.push(new PokemonMove(move.moveId, 0, move.ppUp, move.virtual))); + + return newMoveset; + } } export class EnemyPokemon extends Pokemon {