From 785840fdf4b888af6df5be369b5c84f061578da8 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 2 Apr 2024 23:12:30 -0400 Subject: [PATCH] Fix crash --- src/field/pokemon.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 7442501aa..36583a369 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -154,18 +154,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.gender = Gender.FEMALE; } } - + + if (this.formIndex === undefined) + this.formIndex = this.scene.getSpeciesFormIndex(species, this.gender, this.nature, this.isPlayer()); + + if (this.shiny === undefined) + this.trySetShiny(); + if (nature !== undefined) this.setNature(nature); else this.generateNature(); - if (this.formIndex === undefined) - this.formIndex = this.scene.getSpeciesFormIndex(species, this.gender, this.getNature(), this.isPlayer()); - - if (this.shiny === undefined) - this.trySetShiny(); - this.friendship = species.baseFriendship; this.metLevel = level; this.metBiome = scene.currentBattle ? scene.arena.biomeType : -1;