Skip to content

Commit

Permalink
ZO fix disc scanner in controller mode (#2633)
Browse files Browse the repository at this point in the history
  • Loading branch information
frzyc authored Jan 26, 2025
1 parent 2c56ff8 commit 7cda611
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions libs/zzz/disc-scanner/src/lib/processImg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
Expand All @@ -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.'
Expand All @@ -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(
Expand Down

0 comments on commit 7cda611

Please sign in to comment.