Fix level up moves not working for spliced Pokemon

pull/7/head
Flashfyre 2023-11-24 08:31:52 -05:00
parent 0f3ecbae12
commit 8ad08edd53
1 changed files with 4 additions and 0 deletions

View File

@ -562,6 +562,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (this.fusionSpecies) {
const fusionLevelMoves = this.getFusionSpeciesForm().getLevelMoves();
const newLevelMoves: LevelMoves = [];
while (levelMoves[0][0] < startingLevel)
levelMoves.shift();
while (fusionLevelMoves[0][0] < startingLevel)
fusionLevelMoves.shift();
for (let l = startingLevel; l <= this.level; l++) {
while (levelMoves.length && levelMoves[0][0] === l) {
const levelMove = levelMoves.shift();