返回提交历史
Modified
src/controllers/api/artifactsController.ts
+11
-1
XFEstudio/SpaceNinjaServer
fix: remove legendary core from inventory when it was used (#819)
16922279
代码差异
1 个文件
+11
-1
@@ -2,7 +2,7 @@ import { getJSONfromString } from "@/src/helpers/stringHelpers";
2
2
import { getAccountIdForRequest } from "@/src/services/loginService";
3
3
import { RequestHandler } from "express";
4
4
import { ICrewShipSalvagedWeaponSkin } from "@/src/types/inventoryTypes/inventoryTypes";
5
import { getInventory } from "@/src/services/inventoryService";
5
import { addMods, getInventory } from "@/src/services/inventoryService";
6
6
import { config } from "@/src/services/configService";
7
7
8
8
export const artifactsController: RequestHandler = async (req, res) => {
@@ -48,6 +48,15 @@ export const artifactsController: RequestHandler = async (req, res) => {
48
48
inventory.FusionPoints -= FusionPointCost;
49
49
}
50
50
51
if (artifactsData.LegendaryFusion) {
52
addMods(inventory, [
53
{
54
ItemType: "/Lotus/Upgrades/Mods/Fusers/LegendaryModFuser",
55
ItemCount: -1
56
}
57
]);
58
}
59
51
60
const changedInventory = await inventory.save();
52
61
const itemId = changedInventory.toJSON().Upgrades[itemIndex]?.ItemId?.$oid;
53
62
@@ -63,4 +72,5 @@ interface IArtifactsRequest {
63
72
LevelDiff: number;
64
73
Cost: number;
65
74
FusionPointCost: number;
75
LegendaryFusion?: boolean;
66
76
}