Fix /formathelp for past-gen formats

NatDex Mod refactor caught a bug. `format.gen` isn't meaningful.

...maybe it should be... Main concern would be perf impact, to load
all the datamods to get their gen. Probably not worth it?
This commit is contained in:
Guangcong Luo 2025-03-03 04:03:49 -08:00
parent d5f4cbf053
commit 74aa072bfb

View File

@ -1944,7 +1944,8 @@ export const commands: Chat.ChatCommands = {
descHtml.push(...format.threads);
} else {
const genID = ['rb', 'gs', 'rs', 'dp', 'bw', 'xy', 'sm', 'ss', 'sv'];
descHtml.push(`This format has no resources linked on its <a href="https://www.smogon.com/dex/${genID[format.gen - 1] || 'sv'}/formats/">Smogon Dex page</a>. ` +
const gen = Dex.forFormat(format).gen;
descHtml.push(`This format has no resources linked on its <a href="https://www.smogon.com/dex/${genID[gen - 1] || 'sv'}/formats/">Smogon Dex page</a>. ` +
`Please contact a <a href="https://www.smogon.com/forums/forums/757/">C&amp;C Leader</a> to resolve this. ` +
`Alternatively, if this format can't have a page on the Smogon Dex, message <username>dhelmise</username>.<br />`);
}