From 9752ab4c8b3bad41c3364d1921a7e753fbfbf538 Mon Sep 17 00:00:00 2001 From: AlvISs_Reimu Date: Thu, 31 Oct 2024 13:56:11 -0700 Subject: [PATCH] fix: failed to insert element-limited quartz into correct position --- shared/orbmentAssistant.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/orbmentAssistant.ts b/shared/orbmentAssistant.ts index 1e5822e..3b2f06b 100644 --- a/shared/orbmentAssistant.ts +++ b/shared/orbmentAssistant.ts @@ -107,11 +107,11 @@ export const runSimulatedAnnealing = ( const _convertQuartzLineToResultLine = (quartzLine: QuartzLine): ResultLine => { const slots = [...quartzLine.regularSlotQuartzIds] - // insert quartz that is in elment-limited slot into slots in ResultLine + // insert quartz that is in element-limited slot into slots in ResultLine quartzLine.elementLimitedSlots .filter(elementLimitedSlot => elementLimitedSlot.hasQuartz()) - .forEach((elementLimitedSlot, i) => { - slots.splice(i, 0, elementLimitedSlot.quartzId) + .forEach(elementLimitedSlot => { + slots.splice(elementLimitedSlot.position, 0, elementLimitedSlot.quartzId) }) const elements: Record = {} as Record<