From bcef75fb10c77fca05f2a34ebaf2b60a03cba6a8 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sun, 16 Mar 2025 12:02:01 +0100 Subject: [PATCH] Always check requested form first --- src/data/challenge.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index fe10270d6c4..d9f5dc3d24e 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -715,7 +715,6 @@ export class SingleTypeChallenge extends Challenge { { species: Species.CASTFORM, type: PokemonType.NORMAL, fusion: false }, ]; // TODO: Find a solution for all Pokemon with this ssui issue, including Basculin and Burmy - private static SPECIES_OVERRIDES: Species[] = [Species.MELOETTA]; constructor() { super(Challenges.SINGLE_TYPE, 18); @@ -1298,11 +1297,15 @@ export function checkStarterValidForChallenge(species: PokemonSpecies, props: De * @returns `true` if the species is considered valid. */ function checkSpeciesValidForChallenge(species: PokemonSpecies, props: DexAttrProps, soft: boolean) { - if (!soft || !pokemonFormChanges.hasOwnProperty(species.speciesId) || props.formIndex === 0) { - const isValidForChallenge = new Utils.BooleanHolder(true); - applyChallenges(globalScene.gameMode, ChallengeType.STARTER_CHOICE, species, isValidForChallenge, props); + const isValidForChallenge = new Utils.BooleanHolder(true); + applyChallenges(globalScene.gameMode, ChallengeType.STARTER_CHOICE, species, isValidForChallenge, props); + if (!soft || !pokemonFormChanges.hasOwnProperty(species.speciesId)) { return isValidForChallenge.value; } + // If the form in props is valid, return true before checking other form changes + if (soft && isValidForChallenge.value) { + return true; + } pokemonFormChanges[species.speciesId].forEach(f1 => { species.forms.forEach((f2, formIndex) => { if (f1.formKey === f2.formKey) {