From 244c6df4f039a659739a3f164f98bb5179dac54f Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Fri, 24 Oct 2025 08:58:28 +0200 Subject: [PATCH] fix completing a node intro completely reordering NodeIntrosCompleted --- src/services/inventoryService.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 17cdf370..269e5faf 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -1400,6 +1400,12 @@ export const updateGeneric = async (data: IGenericUpdate, accountId: string): Pr const inventoryChanges: IInventoryChanges = {}; for (const node of data.NodeIntrosCompleted) { + if (inventory.NodeIntrosCompleted.indexOf(node) != -1) { + continue; + } + inventory.NodeIntrosCompleted.push(node); + logger.debug(`completed dialogue/cutscene for ${node}`); + if (node == "TC2025") { inventoryChanges.ShipDecorations = [ { @@ -1422,14 +1428,6 @@ export const updateGeneric = async (data: IGenericUpdate, accountId: string): Pr await addEmailItem(inventory, "/Lotus/Types/Items/EmailItems/ClearedFiveLoopsEmailItem", inventoryChanges); } } - - // Combine the two arrays into one. - data.NodeIntrosCompleted = inventory.NodeIntrosCompleted.concat(data.NodeIntrosCompleted); - - // Remove duplicate entries. - const nodes = [...new Set(data.NodeIntrosCompleted)]; - - inventory.NodeIntrosCompleted = nodes; await inventory.save(); return {