Teambuilder: Deprioritize Illegal Pokemon (#2606)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run

This commit is contained in:
Ethan Strader 2026-03-15 02:03:14 -04:00 committed by GitHub
parent fff081a1de
commit 3b0707924d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -435,6 +435,13 @@ export class DexSearch {
bufs[0] = [['header', DexSearch.typeName[type]]]; bufs[0] = [['header', DexSearch.typeName[type]]];
} }
if (!(id in illegal)) typeIndex = 0; if (!(id in illegal)) typeIndex = 0;
// Move illegal pokemon to the bottom of the results
if (id in illegal && searchTypeIndex === 1) {
typeIndex = 8;
if (!bufs[typeIndex].length) {
bufs[typeIndex] = [['header', "Illegal Pok\u00e9mon"]];
}
}
} else { } else {
if (!bufs[typeIndex].length) { if (!bufs[typeIndex].length) {
bufs[typeIndex] = [['header', DexSearch.typeName[type]]]; bufs[typeIndex] = [['header', DexSearch.typeName[type]]];