From 7b9d1d6570a9560909acad59a8b47c263eb1d7ad Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Fri, 14 Feb 2025 21:51:41 -0500 Subject: [PATCH] [Hotfix] Fix crash involving female Pyroar fusions with exp sprites (#5331) * Fix crash involving female Pyroar fusions with exp sprites * Update locales submodule --- package-lock.json | 4 +-- package.json | 2 +- public/images/pokemon/668-female.json | 41 -------------------------- public/images/pokemon/668-female.png | Bin 898 -> 0 bytes public/locales | 2 +- src/field/pokemon.ts | 9 ++++-- 6 files changed, 11 insertions(+), 47 deletions(-) delete mode 100644 public/images/pokemon/668-female.json delete mode 100644 public/images/pokemon/668-female.png diff --git a/package-lock.json b/package-lock.json index 2ae45b1e2c2..ce1feb7db41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.6.3", + "version": "1.6.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.6.3", + "version": "1.6.4", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 495815be15d..c9b5798af76 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.6.3", + "version": "1.6.4", "type": "module", "scripts": { "start": "vite", diff --git a/public/images/pokemon/668-female.json b/public/images/pokemon/668-female.json deleted file mode 100644 index 13d67c90194..00000000000 --- a/public/images/pokemon/668-female.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "textures": [ - { - "image": "668-female.png", - "format": "RGBA8888", - "size": { - "w": 72, - "h": 72 - }, - "scale": 1, - "frames": [ - { - "filename": "0001.png", - "rotated": false, - "trimmed": false, - "sourceSize": { - "w": 63, - "h": 72 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 63, - "h": 72 - }, - "frame": { - "x": 0, - "y": 0, - "w": 63, - "h": 72 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:3f88e039152d4a967a218cb721938610:e6991ce9c3bad348cbc05ebf9b440302:d99ed0e84a0695b54e479aa98271aba1$" - } -} diff --git a/public/images/pokemon/668-female.png b/public/images/pokemon/668-female.png deleted file mode 100644 index c8f4e205491a3c9298afb167fad34989f8374085..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 898 zcmV-|1AY97P)9ipC~f?H~&!QiD!hish$88UPV zX(u5MN3Tnl78^R0QcSc72YT@Sk_7y}^xnye&XO&Ec#yfDzW0!f$u4>Rk(|gR-)KI>MZL8`JY?jNP&BPpk z6|3KFQ6lfn-Xc{mT6Lf2H;>h)Axik%pjItc)tU~_I*I3uq1tV~#v*s8`={!Q&I&?M zEt~!CDA|j+TdhG$g9vL!E*a^euWJRRMZ~jg`J-=0@=t+I%akdP8K*>eQUBYPZAT?F7FrJ>ozcaRU5 zxHTzg-8A_bJ&aN_4fI8G8h0oG=;o!VGS})bQdotb6mO_W5BVh`EjEaFjJ^68!pF@y zKNr|r^idL66vPgq{YMaac5iN$<`D}J=>Z}Z6{ct!1w6o=b}OCL4pIuFMFEdl+^sYR z+98=pSuV1y;Cw~{1+qn`+l0J9bs9_RNhuf9PQ$q!iV|7s*{n8=1qqF6k#^>JMOf;& zYLMrk8KPFnA^@cd9}x*V^st8{KK6IMJ@!Ts9iW;x2@fGMA0TB>K^!zYh?0GDriQ5Y z8x%IkUQq`n7I8dvkr(!m{cmaZMzm80P=bitw=s+_cc?Jepa4b?W7MDxsDmhxQna^w zC5S`gxPlIm0H+S(D*z79$it~aR6+?BIT<1;G`{iCFewBmM58JZ8*DnI@Qs{Qj2#F6 Y0boY}eU9#KL;wH)07*qoM6N<$f?NrLjQ{`u diff --git a/public/locales b/public/locales index f917baa1bb2..58dda14ee83 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit f917baa1bb2fc5071587b7894ce7b4898cc64f36 +Subproject commit 58dda14ee834204c4bd5ece47694a3c068df4b0e diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index b1e48df5c61..5c6fbb34aea 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4042,6 +4042,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } + if (fusionPixelColors.length === 0) { // ERROR HANDLING IS NOT OPTIONAL BUDDY + console.log("Failed to create fusion palette"); + return; + } + let paletteColors: Map; let fusionPaletteColors: Map; @@ -4055,8 +4060,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { Math.random = originalRandom; - paletteColors = paletteColors!; // tell TS compiler that paletteColors is defined! - fusionPaletteColors = fusionPaletteColors!; // TS compiler that fusionPaletteColors is defined! + paletteColors = paletteColors!; // erroneously tell TS compiler that paletteColors is defined! + fusionPaletteColors = fusionPaletteColors!; // mischievously misinform TS compiler that fusionPaletteColors is defined! const [ palette, fusionPalette ] = [ paletteColors, fusionPaletteColors ] .map(paletteColors => { let keys = Array.from(paletteColors.keys()).sort((a: number, b: number) => paletteColors.get(a)! < paletteColors.get(b)! ? 1 : -1);