diff --git a/src/FormatEftToEsi/FormatEftToEsi.stories.tsx b/src/FormatEftToEsi/FormatEftToEsi.stories.tsx index fe29766..d3d5977 100644 --- a/src/FormatEftToEsi/FormatEftToEsi.stories.tsx +++ b/src/FormatEftToEsi/FormatEftToEsi.stories.tsx @@ -51,6 +51,8 @@ Loki Core - Augmented Nuclear Reactor Loki Defensive - Covert Reconfiguration Loki Offensive - Launcher Efficiency Configuration Loki Propulsion - Wake Limiter + +Hammerhead II x1 `, }, decorators: [withEveDataProvider], diff --git a/src/FormatEftToEsi/FormatEftToEsi.tsx b/src/FormatEftToEsi/FormatEftToEsi.tsx index 585d359..706f54f 100644 --- a/src/FormatEftToEsi/FormatEftToEsi.tsx +++ b/src/FormatEftToEsi/FormatEftToEsi.tsx @@ -81,7 +81,8 @@ export function useFormatEftToEsi() { continue; } - const itemType = line.split(",")[0].trim(); + const itemType = line.split(",")[0].split(" x")[0].trim(); + const itemCount = parseInt(line.split(",")[0].split(" x")[1]?.trim() ?? "1"); const itemTypeId = lookupTypeByName(itemType); if (itemTypeId === undefined) throw new Error(`Unknown item '${itemType}'.`); @@ -99,7 +100,7 @@ export function useFormatEftToEsi() { /* Ignore items we don't care about. */ if (slotType === "") continue; - esiFit.items.push({"flag": EsiFlagMapping[slotType] + slotIndex[slotType], "quantity": 1, "type_id": itemTypeId}); + esiFit.items.push({"flag": EsiFlagMapping[slotType] + slotIndex[slotType], "quantity": itemCount, "type_id": itemTypeId}); slotIndex[slotType]++; }