From dcea9e3cd0c1fe4f8796bf2a6f0300a4c2753c74 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Thu, 24 Dec 2015 05:54:12 -0500 Subject: [PATCH] Teambuilder: Past gen ability selection The Ability menu now works correctly for past gen formats. --- js/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/search.js b/js/search.js index 9d73569fa..1fd30a751 100644 --- a/js/search.js +++ b/js/search.js @@ -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'])]); }