mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 00:36:25 +00:00
Fix crash when generating trainer party member
This commit is contained in:
parent
678a76394a
commit
6de5e7ebc6
@ -146,7 +146,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
||||
const tierValue = Utils.randSeedInt(512);
|
||||
let tier = tierValue >= 156 ? TrainerPoolTier.COMMON : tierValue >= 32 ? TrainerPoolTier.UNCOMMON : tierValue >= 6 ? TrainerPoolTier.RARE : tierValue >= 1 ? TrainerPoolTier.SUPER_RARE : TrainerPoolTier.ULTRA_RARE
|
||||
console.log(TrainerPoolTier[tier]);
|
||||
while (!this.config.speciesPools[tier].length) {
|
||||
while (!this.config.speciesPools.hasOwnProperty(tier) || !this.config.speciesPools[tier].length) {
|
||||
console.log(`Downgraded trainer Pokemon rarity tier from ${TrainerPoolTier[tier]} to ${TrainerPoolTier[tier - 1]}`);
|
||||
tier--;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user