Skip to content

Commit

Permalink
Tournaments: support base formes in /tour banlist
Browse files Browse the repository at this point in the history
  • Loading branch information
sirDonovan authored May 19, 2017
1 parent e80b76d commit b54dfaa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tournaments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,23 @@ class Tournament {
}
ban = 'Rule:' + subformat.name;
} else {
param = param.toLowerCase();
let baseForme = false;
if (param.endsWith('-base')) {
baseForme = true;
param = param.substr(0, param.length - 5);
}
let search = Dex.dataSearch(param);
if (!search || search.length < 1) continue;
search = search[0];
if (search.isInexact || search.searchType === 'nature') continue;
ban = search.name;
if (baseForme) ban += '-Base';
if (unban) {
if (format.banlistTable[search.name] === false) continue;
if (format.banlistTable[ban] === false) continue;
} else {
if (format.banlistTable[search.name]) continue;
if (format.banlistTable[ban]) continue;
}
ban = search.name;
}
if (unban) {
oppositeBan = ban;
Expand Down

0 comments on commit b54dfaa

Please sign in to comment.