Skip to content

Commit

Permalink
Fix duplicate formats in watch battle format list
Browse files Browse the repository at this point in the history
Closes smogon#856
  • Loading branch information
Zarel committed Jan 30, 2017
1 parent 2f61b7d commit 0fd9108
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/client-mainmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@
if (selectType === 'teambuilder') {
if (!format.isTeambuilderFormat) continue;
} else {
if (format.effectType !== 'Format') continue;
if (format.effectType !== 'Format' || format.battleFormat) continue;
if (selectType != 'watch' && !format[selectType + 'Show']) continue;
}

Expand Down
2 changes: 1 addition & 1 deletion js/client-teambuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@
return;
}

if (window.BattleFormats && BattleFormats[format] && BattleFormats[format].hasBattleFormat) {
if (window.BattleFormats && BattleFormats[format] && BattleFormats[format].battleFormat) {
format = BattleFormats[format].battleFormat;
}
app.sendTeam(this.curTeam);
Expand Down
2 changes: 0 additions & 2 deletions js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1126,10 +1126,8 @@
// The base format is not available.
if (teambuilderFormat.battleFormat) {
multivariantFormats[teambuilderFormat.id] = 1;
teambuilderFormat.hasBattleFormat = false;
teambuilderFormat.battleFormat = '';
} else {
teambuilderFormat.hasBattleFormat = true;
teambuilderFormat.battleFormat = id;
}
}
Expand Down

0 comments on commit 0fd9108

Please sign in to comment.