From 9b03d6f8d30c252aca5c596143b5d32e83428078 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 20 Apr 2024 16:08:33 -0400 Subject: [PATCH] Fix crash related to fusion sprites --- src/field/pokemon.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 6cbbcd0d079..a7c383d9818 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2043,7 +2043,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { for (let f = 0; f < 2; f++) { const variantColors = variantColorCache[!f ? spriteKey : backSpriteKey]; let variantColorSet = new Map(); - if (variantColors) { + if (this.shiny && variantColors && variantColors[this.variant]) { Object.keys(variantColors[this.variant]).forEach(k => { variantColorSet.set(Utils.rgbaToInt(Array.from(Object.values(Utils.rgbHexToRgba(k)))), Array.from(Object.values(Utils.rgbHexToRgba(variantColors[this.variant][k])))); }); @@ -2082,7 +2082,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { for (let f = 0; f < 2; f++) { const variantColors = variantColorCache[!f ? fusionSpriteKey : fusionBackSpriteKey]; let variantColorSet = new Map(); - if (variantColors) { + if (this.fusionShiny && variantColors && variantColors[this.fusionVariant]) { Object.keys(variantColors[this.fusionVariant]).forEach(k => { variantColorSet.set(Utils.rgbaToInt(Array.from(Object.values(Utils.rgbHexToRgba(k)))), Array.from(Object.values(Utils.rgbHexToRgba(variantColors[this.fusionVariant][k])))); });