From fae5b642f64c2442904583ad6864ddb2ff03437c Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 7 Apr 2024 00:28:37 -0400 Subject: [PATCH] Improve fusion names with a space present --- src/data/pokemon-species.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 32bd8f19610..f6dba5687af 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -39,7 +39,7 @@ export function getFusedSpeciesName(speciesAName: string, speciesBName: string): const fragAPattern = /([a-z]{2}.*?[aeiou(?:y$)\-\']+)(.*?)$/i; const fragBPattern = /([a-z]{2}.*?[aeiou(?:y$)\-\'])(.*?)$/i; - const [ speciesAPrefixMatch, speciesBPrefixMatch ] = [ speciesAName, speciesBName ].map(n => /^(?:Mega|(?:G|E)\-Max) /.exec(n)); + const [ speciesAPrefixMatch, speciesBPrefixMatch ] = [ speciesAName, speciesBName ].map(n => /^(?:[^ ]+) /.exec(n)); const [ speciesAPrefix, speciesBPrefix ] = [ speciesAPrefixMatch, speciesBPrefixMatch ].map(m => m ? m[0] : ''); if (speciesAPrefix) @@ -47,7 +47,7 @@ export function getFusedSpeciesName(speciesAName: string, speciesBName: string): if (speciesBPrefix) speciesBName = speciesBName.slice(speciesBPrefix.length); - const [ speciesASuffixMatch, speciesBSuffixMatch ] = [ speciesAName, speciesBName ].map(n => / (?:X|Y)$/.exec(n)); + const [ speciesASuffixMatch, speciesBSuffixMatch ] = [ speciesAName, speciesBName ].map(n => / (?:[^ ]+)$/.exec(n)); const [ speciesASuffix, speciesBSuffix ] = [ speciesASuffixMatch, speciesBSuffixMatch ].map(m => m ? m[0] : ''); if (speciesASuffix)