From 8ad979ab11f04e3271958717eb0efe81de5001eb Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 23 Dec 2024 23:32:33 +0100 Subject: [PATCH] fix: can't dissolve arcanes (#634) --- src/controllers/api/sellController.ts | 9 ++++++++- src/types/sellTypes.ts | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/sellController.ts b/src/controllers/api/sellController.ts index 0abf41fc..7417018c 100644 --- a/src/controllers/api/sellController.ts +++ b/src/controllers/api/sellController.ts @@ -1,7 +1,7 @@ import { RequestHandler } from "express"; import { ISellRequest } from "@/src/types/sellTypes"; import { getAccountIdForRequest } from "@/src/services/loginService"; -import { getInventory, addMods, addRecipes } from "@/src/services/inventoryService"; +import { getInventory, addMods, addRecipes, addMiscItems } from "@/src/services/inventoryService"; export const sellController: RequestHandler = async (req, res) => { const payload = JSON.parse(String(req.body)) as ISellRequest; @@ -13,6 +13,13 @@ export const sellController: RequestHandler = async (req, res) => { inventory.RegularCredits += payload.SellPrice; } else if (payload.SellCurrency == "SC_FusionPoints") { inventory.FusionPoints += payload.SellPrice; + } else if (payload.SellCurrency == "SC_DistillPoints") { + addMiscItems(inventory, [ + { + ItemType: "/Lotus/Types/Items/MiscItems/DistillPoints", + ItemCount: payload.SellPrice + } + ]); } else { throw new Error("Unknown SellCurrency: " + payload.SellCurrency); } diff --git a/src/types/sellTypes.ts b/src/types/sellTypes.ts index 624b7186..03b46818 100644 --- a/src/types/sellTypes.ts +++ b/src/types/sellTypes.ts @@ -12,6 +12,7 @@ export interface ISellRequest { | "SC_RegularCredits" | "SC_PrimeBucks" | "SC_FusionPoints" + | "SC_DistillPoints" | "SC_CrewShipFusionPoints" | "SC_Resources"; buildLabel: string;