Teambuilder: Past gen ability selection

The Ability menu now works correctly for past gen formats.
This commit is contained in:
Guangcong Luo
2015-12-24 05:54:12 -05:00
parent 4981a223b0
commit dcea9e3cd0

View File

@@ -689,10 +689,10 @@
template = Tools.getTemplate(template.baseSpecies);
}
abilitySet.push(['ability', toId(template.abilities['0'])]);
if (template.abilities['1']) {
if (template.abilities['1'] && Tools.getAbility(template.abilities['1']).gen <= this.gen) {
abilitySet.push(['ability', toId(template.abilities['1'])]);
}
if (template.abilities['H']) {
if (template.abilities['H'] && this.gen >= 5) {
abilitySet.push(['header', "Hidden Ability"]);
abilitySet.push(['ability', toId(template.abilities['H'])]);
}