From d2f7327c7408fa3ce2b81a71f7874939306192fd Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Tue, 15 Dec 2015 20:20:20 -0500 Subject: [PATCH] Choose default team using teambuilderFormat Before, 'UU (suspect test)' was treated differently from 'UU' when choosing the default team in the dropdown. It no longer is. --- js/client-mainmenu.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/client-mainmenu.js b/js/client-mainmenu.js index 104112ebf..10597decc 100644 --- a/js/client-mainmenu.js +++ b/js/client-mainmenu.js @@ -736,6 +736,10 @@ if (window.BattleFormats[formatid].team) { return ''; } + + var format = window.BattleFormats[formatid]; + var teamFormat = (format.teambuilderFormat || (format.isTeambuilderFormat ? formatid : false)); + var teams = Storage.teams; if (!teams.length) { return ''; @@ -744,9 +748,9 @@ if (this.curTeamIndex >= 0) { teamIndex = this.curTeamIndex; } - if (this.curTeamFormat !== formatid) { + if (this.curTeamFormat !== teamFormat) { for (var i = 0; i < teams.length; i++) { - if (teams[i].format === formatid) { + if (teams[i].format === teamFormat) { teamIndex = i; break; }