diff --git a/play.pokemonshowdown.com/src/panel-mainmenu.tsx b/play.pokemonshowdown.com/src/panel-mainmenu.tsx index 297fa05ee8..22bed2e9b9 100644 --- a/play.pokemonshowdown.com/src/panel-mainmenu.tsx +++ b/play.pokemonshowdown.com/src/panel-mainmenu.tsx @@ -818,10 +818,12 @@ export class TeamForm extends preact.Component<{ submit = (ev: Event, validate?: 'validate') => { ev.preventDefault(); const format = this.format; + // in tournaments, format is the custom name & teamFormat is the original format. + const teambuilderFormat = this.props.teamFormat; const teamElement = this.base!.querySelector('button[name=team]'); const teamKey = teamElement!.value; const team = teamKey ? PS.teams.byKey[teamKey] : undefined; - if (!window.BattleFormats[PS.teams.teambuilderFormat(format)]?.team && !team) { + if (!window.BattleFormats[teambuilderFormat || PS.teams.teambuilderFormat(format)]?.team && !team) { PS.alert('You need to go into the Teambuilder and build a team for this format.', { parentElem: teamElement!, });