From b17aae9aa5f3fec2dc9420a13349f272534a079a Mon Sep 17 00:00:00 2001 From: livid washed <115855253+livid-washed@users.noreply.github.com> Date: Mon, 10 Apr 2023 23:58:51 +0200 Subject: [PATCH] Old Gens Random Battles: allow battle only formes to generate in Monotype battles (#9490) --- data/mods/gen8/random-teams.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/mods/gen8/random-teams.ts b/data/mods/gen8/random-teams.ts index 21581bf54c..c3107b442a 100644 --- a/data/mods/gen8/random-teams.ts +++ b/data/mods/gen8/random-teams.ts @@ -2406,14 +2406,14 @@ export class RandomGen8Teams { ) { const exclude = pokemonToExclude.map(p => toID(p.species)); const pokemonPool = []; - for (let species of this.dex.species.all()) { + for (const species of this.dex.species.all()) { if (species.gen > this.gen || exclude.includes(species.id)) continue; if (this.dex.currentMod === 'gen8bdsp' && species.gen > 4) continue; if (isMonotype) { if (!species.types.includes(type)) continue; if (typeof species.battleOnly === 'string') { - species = this.dex.species.get(species.battleOnly); - if (!species.types.includes(type)) continue; + const baseSpecies = this.dex.species.get(species.battleOnly); + if (!baseSpecies.types.includes(type)) continue; } } pokemonPool.push(species.id);