mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-18 15:00:55 +00:00
Fix crash related to fusion sprites
This commit is contained in:
parent
d9a685611d
commit
9b03d6f8d3
@ -2043,7 +2043,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
for (let f = 0; f < 2; f++) {
|
for (let f = 0; f < 2; f++) {
|
||||||
const variantColors = variantColorCache[!f ? spriteKey : backSpriteKey];
|
const variantColors = variantColorCache[!f ? spriteKey : backSpriteKey];
|
||||||
let variantColorSet = new Map<integer, integer[]>();
|
let variantColorSet = new Map<integer, integer[]>();
|
||||||
if (variantColors) {
|
if (this.shiny && variantColors && variantColors[this.variant]) {
|
||||||
Object.keys(variantColors[this.variant]).forEach(k => {
|
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]))));
|
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++) {
|
for (let f = 0; f < 2; f++) {
|
||||||
const variantColors = variantColorCache[!f ? fusionSpriteKey : fusionBackSpriteKey];
|
const variantColors = variantColorCache[!f ? fusionSpriteKey : fusionBackSpriteKey];
|
||||||
let variantColorSet = new Map<integer, integer[]>();
|
let variantColorSet = new Map<integer, integer[]>();
|
||||||
if (variantColors) {
|
if (this.fusionShiny && variantColors && variantColors[this.fusionVariant]) {
|
||||||
Object.keys(variantColors[this.fusionVariant]).forEach(k => {
|
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]))));
|
variantColorSet.set(Utils.rgbaToInt(Array.from(Object.values(Utils.rgbHexToRgba(k)))), Array.from(Object.values(Utils.rgbHexToRgba(variantColors[this.fusionVariant][k]))));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user