From e6c6579a4f2a645ad15a3270999181765d9f06b2 Mon Sep 17 00:00:00 2001 From: frzyc Date: Sun, 26 Jan 2025 14:15:30 -0500 Subject: [PATCH] ZO fix disc scanner in controller mode --- libs/zzz/disc-scanner/src/lib/processImg.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libs/zzz/disc-scanner/src/lib/processImg.ts b/libs/zzz/disc-scanner/src/lib/processImg.ts index 6301b7382e..1c0cc08c5f 100644 --- a/libs/zzz/disc-scanner/src/lib/processImg.ts +++ b/libs/zzz/disc-scanner/src/lib/processImg.ts @@ -82,14 +82,12 @@ export async function processEntry( const substatTextIndex = whiteTexts.findIndex((t) => t.toLowerCase().includes('sub-stats') ) - const setEffectTextIndex = whiteTexts.findIndex((t) => + let setEffectTextIndex = whiteTexts.findIndex((t) => t.toLowerCase().includes('set effect') ) - if ( - mainStatTextIndex === -1 || - substatTextIndex === -1 || - setEffectTextIndex === -1 - ) { + if (setEffectTextIndex === -1) setEffectTextIndex = whiteTexts.length - 1 + + if (mainStatTextIndex === -1 || substatTextIndex === -1) { retProcessed.texts.push( 'Could not detect main stat, substats or set effect.' ) @@ -108,8 +106,7 @@ export async function processEntry( if ( setLvlTexts.length === 0 || mainStatTexts.length === 0 || - substatTexts.length === 0 || - setEffectTexts.length === 0 + substatTexts.length === 0 ) { retProcessed.texts.push( 'Could not detect main stat, substats or set effect.' @@ -120,7 +117,7 @@ export async function processEntry( // Join all text above the "Main Stat" text due to set text wrapping let { slotKey, setKey } = parseSetSlot([setLvlTexts.join('')]) if (!setKey) { - setKey = parseSet(setEffectTexts) + if (setEffectTexts.length) setKey = parseSet(setEffectTexts) if (!setKey) { setKey = 'AstralVoice' retProcessed.texts.push(