From 0b70effd0251cd34d38d914c7f8c1808b5e7394e Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 18 Feb 2024 23:01:44 -0500 Subject: [PATCH] Revert "Update Phaser to 3.80.0 beta 2" This reverts commit 993ab264e78f7124ecfcd559df35237335794141. --- package-lock.json | 14 +++++++------- package.json | 2 +- src/trainer.ts | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50b02aaed..384b4469d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@material/material-color-utilities": "^0.2.7", "crypto-js": "^4.2.0", "json-stable-stringify": "^1.1.0", - "phaser": "^3.80.0-beta.2", + "phaser": "^3.70.0", "phaser3-rex-plugins": "^1.1.84" }, "devDependencies": { @@ -2135,9 +2135,9 @@ "dev": true }, "node_modules/phaser": { - "version": "3.80.0-beta.2", - "resolved": "https://registry.npmjs.org/phaser/-/phaser-3.80.0-beta.2.tgz", - "integrity": "sha512-W2NDQlPV8nFTpYF6wJ6zwqFAKEygih1G0J6IdA2gGF61wYy2CYtTN25o6i6E52p7hRc3amX/uDS5eIT+dMrN5g==", + "version": "3.70.0", + "resolved": "https://registry.npmjs.org/phaser/-/phaser-3.70.0.tgz", + "integrity": "sha512-2g+gh+Jp9f/Ho9FOXOYbIJMGf3UZXyMbW2iLScFaLQw11e/LqVyxj/YmaBauWbHabeTnZjiWkPklDnxhesMH0g==", "dependencies": { "eventemitter3": "^5.0.1" } @@ -2630,9 +2630,9 @@ } }, "node_modules/vite": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", - "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.1.tgz", + "integrity": "sha512-AXXFaAJ8yebyqzoNB9fu2pHoo/nWX+xZlaRwoeYUxEqBO+Zj4msE5G+BhGBll9lYEKv9Hfks52PAF2X7qDYXQA==", "dev": true, "dependencies": { "esbuild": "^0.18.10", diff --git a/package.json b/package.json index 06a4e808f..e0ec65880 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@material/material-color-utilities": "^0.2.7", "crypto-js": "^4.2.0", "json-stable-stringify": "^1.1.0", - "phaser": "^3.80.0-beta.2", + "phaser": "^3.70.0", "phaser3-rex-plugins": "^1.1.84" } } diff --git a/src/trainer.ts b/src/trainer.ts index df3640409..498a4e6e0 100644 --- a/src/trainer.ts +++ b/src/trainer.ts @@ -20,6 +20,10 @@ export default class Trainer extends Phaser.GameObjects.Container { this.female = female; this.partyTemplateIndex = Math.min(partyTemplateIndex !== undefined ? partyTemplateIndex : Utils.randSeedWeightedItem(this.config.partyTemplates.map((_, i) => i)), this.config.partyTemplates.length - 1); + + // TODO: Remove when Phaser weightedPick bug is fixed + if (isNaN(this.partyTemplateIndex)) + this.partyTemplateIndex = this.config.partyTemplates.length - 1; console.log(Object.keys(trainerPartyTemplates)[Object.values(trainerPartyTemplates).indexOf(this.getPartyTemplate())]);