fix: can't dissolve arcanes
This commit is contained in:
parent
7fdb59f6c9
commit
f6fa7f4711
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { ISellRequest } from "@/src/types/sellTypes";
|
import { ISellRequest } from "@/src/types/sellTypes";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
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) => {
|
export const sellController: RequestHandler = async (req, res) => {
|
||||||
const payload = JSON.parse(String(req.body)) as ISellRequest;
|
const payload = JSON.parse(String(req.body)) as ISellRequest;
|
||||||
@ -13,6 +13,13 @@ export const sellController: RequestHandler = async (req, res) => {
|
|||||||
inventory.RegularCredits += payload.SellPrice;
|
inventory.RegularCredits += payload.SellPrice;
|
||||||
} else if (payload.SellCurrency == "SC_FusionPoints") {
|
} else if (payload.SellCurrency == "SC_FusionPoints") {
|
||||||
inventory.FusionPoints += payload.SellPrice;
|
inventory.FusionPoints += payload.SellPrice;
|
||||||
|
} else if (payload.SellCurrency == "SC_DistillPoints") {
|
||||||
|
addMiscItems(inventory, [
|
||||||
|
{
|
||||||
|
ItemType: "/Lotus/Types/Items/MiscItems/DistillPoints",
|
||||||
|
ItemCount: payload.SellPrice
|
||||||
|
}
|
||||||
|
]);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Unknown SellCurrency: " + payload.SellCurrency);
|
throw new Error("Unknown SellCurrency: " + payload.SellCurrency);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ export interface ISellRequest {
|
|||||||
| "SC_RegularCredits"
|
| "SC_RegularCredits"
|
||||||
| "SC_PrimeBucks"
|
| "SC_PrimeBucks"
|
||||||
| "SC_FusionPoints"
|
| "SC_FusionPoints"
|
||||||
|
| "SC_DistillPoints"
|
||||||
| "SC_CrewShipFusionPoints"
|
| "SC_CrewShipFusionPoints"
|
||||||
| "SC_Resources";
|
| "SC_Resources";
|
||||||
buildLabel: string;
|
buildLabel: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user