Merge branch 'beta' into mystery-encounters

This commit is contained in:
ImperialSympathizer 2024-09-13 09:33:47 -04:00 committed by GitHub
commit a0ac4adbaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -995,15 +995,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
delete starterAttributes.shiny; delete starterAttributes.shiny;
} }
if (starterAttributes.variant !== undefined && !isNaN(starterAttributes.variant)) { if (starterAttributes.variant !== undefined) {
const unlockedVariants = [ const unlockedVariants = [
hasNonShiny,
hasShiny && caughtAttr & DexAttr.DEFAULT_VARIANT, hasShiny && caughtAttr & DexAttr.DEFAULT_VARIANT,
hasShiny && caughtAttr & DexAttr.VARIANT_2, hasShiny && caughtAttr & DexAttr.VARIANT_2,
hasShiny && caughtAttr & DexAttr.VARIANT_3 hasShiny && caughtAttr & DexAttr.VARIANT_3
]; ];
if (!unlockedVariants[starterAttributes.variant + 1]) { // add 1 as -1 = non-shiny if (isNaN(starterAttributes.variant) || starterAttributes.variant < 0 || !unlockedVariants[starterAttributes.variant]) {
// requested variant wasn't unlocked, purging setting // variant value is invalid or requested variant wasn't unlocked, purging setting
delete starterAttributes.variant; delete starterAttributes.variant;
} }
} }