From ebe6dee89239843ceffb18c48e213b43337570dd Mon Sep 17 00:00:00 2001 From: Aurastic <33085835+ISenseAura@users.noreply.github.com> Date: Sun, 15 Mar 2026 16:57:08 +0530 Subject: [PATCH] Preact: Fix team requirement logic for custom named tournaments (#2579) --- play.pokemonshowdown.com/src/panel-mainmenu.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/src/panel-mainmenu.tsx b/play.pokemonshowdown.com/src/panel-mainmenu.tsx index 5005d47df..e2b62b2cb 100644 --- a/play.pokemonshowdown.com/src/panel-mainmenu.tsx +++ b/play.pokemonshowdown.com/src/panel-mainmenu.tsx @@ -830,10 +830,12 @@ export class TeamForm extends preact.Component<{ submit = (ev: Event, validate?: 'validate') => { ev.preventDefault(); let format = this.format; + // in tournaments, format is the custom name & teamFormat is the original format. + const teambuilderFormat = this.props.teamFormat || PS.teams.teambuilderFormat(format); 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]?.team && !team) { PS.alert('You need to go into the Teambuilder and build a team for this format.', { parentElem: teamElement!, });