Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build-tools/build-indexes
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const toID = Dex.toID;
const ModConfigData = require('../config/mod-config').ModConfigData;
const ModConfig = ModConfigData.ClientMods;
var Formats = require('../caches/DH2/dist/config/formats.js').Formats;
var OfficialFormats = require('../caches/DH2/dist/config/official-formats.js').Formats;

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

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

Expand Down