From 4531ef1ff27b82fa7a663a03ea1700dfe9f93100 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 7 Apr 2024 22:56:22 -0400 Subject: [PATCH] Fix minor issue with fusion name generation --- src/data/pokemon-species.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 69797811b..3142748ab 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -73,8 +73,15 @@ export function getFusedSpeciesName(speciesAName: string, speciesBName: string): const lastCharA = fragA.slice(fragA.length - 1); const prevCharB = fragBMatch[1].slice(fragBMatch.length - 1); fragB = (/[\-']/.test(prevCharB) ? prevCharB : '') + fragBMatch[2] || prevCharB; - if (lastCharA === fragB[0] && /[aiu]/.test(lastCharA)) - fragB = fragB.slice(1); + if (lastCharA === fragB[0]) { + if (/[aiu]/.test(lastCharA)) + fragB = fragB.slice(1); + else { + const newCharMatch = new RegExp(`[^${lastCharA}]`).exec(fragB); + if (newCharMatch.index > 0) + fragB = fragB.slice(newCharMatch.index); + } + } } else fragB = speciesBName; } else