From 7ed8dba46ad3ac6203a885a0399b281364bdac89 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 19 Apr 2024 01:44:51 -0400 Subject: [PATCH] Fix undefined variant for existing shinies in runs --- src/field/pokemon.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 59622c524..2eddadd1a 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -134,6 +134,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.stats = dataSource.stats; this.ivs = dataSource.ivs; this.passive = !!dataSource.passive; + if (this.variant === undefined) + this.variant = 0; this.nature = dataSource.nature || 0 as Nature; this.natureOverride = dataSource.natureOverride !== undefined ? dataSource.natureOverride : -1; this.moveset = dataSource.moveset; @@ -147,7 +149,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.fusionFormIndex = dataSource.fusionFormIndex; this.fusionAbilityIndex = dataSource.fusionAbilityIndex; this.fusionShiny = dataSource.fusionShiny; - this.fusionVariant = dataSource.fusionVariant; + this.fusionVariant = dataSource.fusionVariant || 0; this.fusionGender = dataSource.fusionGender; } else { this.id = Utils.randSeedInt(4294967296);