返回提交历史
Modified
src/controllers/api/syndicateSacrificeController.ts
+8
-11
XFEstudio/SpaceNinjaServer
fix: handle acquisition of weapon slots via nightwave (#1591)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1591 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
0928b842
代码差异
1 个文件
+8
-11
@@ -3,15 +3,9 @@ import { RequestHandler } from "express";
3
3
import { getAccountIdForRequest } from "@/src/services/loginService";
4
4
import { ExportNightwave, ExportSyndicates, ISyndicateSacrifice } from "warframe-public-export-plus";
5
5
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
6
import {
7
addItem,
8
addMiscItems,
9
combineInventoryChanges,
10
getInventory,
11
updateCurrency
12
} from "@/src/services/inventoryService";
6
import { addMiscItems, combineInventoryChanges, getInventory, updateCurrency } from "@/src/services/inventoryService";
13
7
import { IInventoryChanges } from "@/src/types/purchaseTypes";
14
import { fromStoreItem, isStoreItem } from "@/src/services/itemDataService";
8
import { isStoreItem, toStoreItem } from "@/src/services/itemDataService";
15
9
16
10
export const syndicateSacrificeController: RequestHandler = async (request, response) => {
17
11
const accountId = await getAccountIdForRequest(request);
@@ -77,10 +71,13 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
77
71
res.NewEpisodeReward = true;
78
72
const reward = ExportNightwave.rewards[index];
79
73
let rewardType = reward.uniqueName;
80
if (isStoreItem(rewardType)) {
81
rewardType = fromStoreItem(rewardType);
74
if (!isStoreItem(rewardType)) {
75
rewardType = toStoreItem(rewardType);
82
76
}
83
combineInventoryChanges(res.InventoryChanges, await addItem(inventory, rewardType, reward.itemCount ?? 1));
77
combineInventoryChanges(
78
res.InventoryChanges,
79
(await handleStoreItemAcquisition(rewardType, inventory, reward.itemCount)).InventoryChanges
80
);
84
81
}
85
82
}
86
83