返回提交历史
Modified
src/services/missionInventoryUpdateService.ts
+22
-3
XFEstudio/SpaceNinjaServer
feat: filter recipes from miscItems (#4025)
Closes #4019 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4025 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
a37003d8
代码差异
1 个文件
+22
-3
@@ -10,7 +10,8 @@ import {
10
10
ExportEnemies,
11
11
ExportFusionBundles,
12
12
ExportRelics,
13
ExportRewards
13
ExportRewards,
14
ExportRecipes
14
15
} from "warframe-public-export-plus";
15
16
import type { IMissionInventoryUpdateRequest, IRewardInfo } from "../types/requestTypes.ts";
16
17
import { logger } from "../utils/logger.ts";
@@ -65,6 +66,7 @@ import {
65
66
getMissionDeck,
66
67
getRegion,
67
68
isStoreItem,
69
supplementalRecipes,
68
70
toStoreItem
69
71
} from "./itemDataService.ts";
70
72
import type { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel.ts";
@@ -381,9 +383,26 @@ export const addMissionInventoryUpdates = async (
381
383
addMods(inventory, value);
382
384
break;
383
385
case "MiscItems":
384
case "BonusMiscItems":
385
addMiscItems(inventory, value);
386
case "BonusMiscItems": {
387
const miscItems: ITypeCount[] = [];
388
const recipes: ITypeCount[] = [];
389
// Some old versions puts Recipes into MiscItems, so we need to separate them out to add them to the correct place
390
// https://onlyg.it/OpenWF/SpaceNinjaServer/issues/4019
391
for (const item of value) {
392
if (item.ItemType in ExportRecipes || item.ItemType in supplementalRecipes) {
393
recipes.push(item);
394
} else {
395
miscItems.push(item);
396
}
397
}
398
if (miscItems.length > 0) {
399
addMiscItems(inventory, miscItems);
400
}
401
if (recipes.length > 0) {
402
addRecipes(inventory, recipes);
403
}
386
404
break;
405
}
387
406
case "Consumables":
388
407
if (inventory.dontSubtractConsumables) {
389
408
addConsumables(