Skip to content

Commit faa3562

Browse files
authored
Merge pull request #58 from EnPassant4264/main
Formats defined by mod files
2 parents 10d0325 + 6d804d7 commit faa3562

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

build-tools/build-indexes

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const toID = Dex.toID;
2727
const ModConfigData = require('../config/mod-config').ModConfigData;
2828
const ModConfig = ModConfigData.ClientMods;
2929
var Formats = require('../caches/DH2/dist/config/formats.js').Formats;
30+
var OfficialFormats = require('../caches/DH2/dist/config/official-formats.js').Formats;
3031

3132
for (const modid in Dex.dexes) {
3233
try {
@@ -1192,7 +1193,8 @@ function buildTeambuilderTables() {
11921193
const formatCacheName = toID(Dex.formats.formatsListCache[i].name);
11931194
if (formatCacheMod !== modConfigId) continue;
11941195
// petModFormats[formatCacheMod] = Formats.find(m => m.mod === modConfigId);
1195-
petModFormats[formatCacheName] = Formats.find(m => toID(m.name) === formatCacheName);
1196+
if (modConfigId === 'badnboosted' || modConfigId === 'gen3colosseum') petModFormats[formatCacheName] = OfficialFormats.find(m => toID(m.name) === formatCacheName);
1197+
else petModFormats[formatCacheName] = Formats.find(m => toID(m.name) === formatCacheName);
11961198
const format = petModFormats[formatCacheName];
11971199
let maxGen =
11981200
formatCacheName.substr(0, 3) === 'gen' && parseInt(formatCacheMod.substr(3, 1)) < 10 ? parseInt(formatCacheMod.substr(3, 1)) : 9;
@@ -1733,7 +1735,8 @@ function buildFormatsData() {
17331735

17341736
function buildFormats() {
17351737
Formats = requireNoCache('../caches/DH2/dist/config/formats.js').Formats;
1736-
const buf = 'exports.Formats = ' + es3stringify(Formats) + ';';
1738+
OfficialFormats = requireNoCache('../caches/DH2/dist/config/official-formats.js').Formats;
1739+
const buf = 'exports.Formats = ' + es3stringify(Formats) + es3stringify(OfficialFormats) + ';';
17371740
fs.writeFileSync('play.pokemonshowdown.com/data/formats.js', buf);
17381741
}
17391742

0 commit comments

Comments
 (0)