Skip to content

Commit

Permalink
Sim/teams: Don't redundantly call toID
Browse files Browse the repository at this point in the history
  • Loading branch information
larry-the-table-guy committed Oct 16, 2024
1 parent a38a4f6 commit 2843aa4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sim/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,13 +618,14 @@ export const Teams = new class Teams {
getGenerator(format: Format | string, seed: PRNG | PRNGSeed | null = null) {
let TeamGenerator;
format = Dex.formats.get(format);
if (toID(format).includes('gen9computergeneratedteams')) {
const formatID = toID(format);
if (formatID.includes('gen9computergeneratedteams')) {
TeamGenerator = require(Dex.forFormat(format).dataDir + '/cg-teams').default;
} else if (toID(format).includes('gen9superstaffbrosultimate')) {
} else if (formatID.includes('gen9superstaffbrosultimate')) {
TeamGenerator = require(`../data/mods/gen9ssb/random-teams`).default;
} else if (toID(format).includes('gen9babyrandombattle')) {
} else if (formatID.includes('gen9babyrandombattle')) {
TeamGenerator = require(`../data/random-battles/gen9baby/teams`).default;
} else if (toID(format).includes('gen9randombattle') && format.ruleTable?.has('+pokemontag:cap')) {
} else if (formatID.includes('gen9randombattle') && format.ruleTable?.has('+pokemontag:cap')) {
TeamGenerator = require(`../data/random-battles/gen9cap/teams`).default;
} else {
TeamGenerator = require(`../data/random-battles/${format.mod}/teams`).default;
Expand Down

0 comments on commit 2843aa4

Please sign in to comment.