chore: handle resource being rolled as mission reward (#545)

This commit is contained in:
Sainan 2024-10-12 23:49:06 +02:00 committed by GitHub
parent de6c1da55d
commit cc5713e375
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ import {
ExportGear, ExportGear,
ExportRecipes, ExportRecipes,
ExportRelics, ExportRelics,
ExportResources,
IReward IReward
} from "warframe-public-export-plus"; } from "warframe-public-export-plus";
import { IMissionInventoryUpdateRequest } from "../types/requestTypes"; import { IMissionInventoryUpdateRequest } from "../types/requestTypes";
@ -164,7 +165,10 @@ const formatRewardsToInventoryType = (
addRewardResponse(InventoryChanges, MissionRewards, type, reward.itemCount, "Consumables"); addRewardResponse(InventoryChanges, MissionRewards, type, reward.itemCount, "Consumables");
} else if (type in ExportRecipes) { } else if (type in ExportRecipes) {
addRewardResponse(InventoryChanges, MissionRewards, type, reward.itemCount, "Recipes"); addRewardResponse(InventoryChanges, MissionRewards, type, reward.itemCount, "Recipes");
} else if (type in ExportRelics) { } else if (
type in ExportRelics ||
(type in ExportResources && ExportResources[type].productCategory == "MiscItems")
) {
addRewardResponse(InventoryChanges, MissionRewards, type, reward.itemCount, "MiscItems"); addRewardResponse(InventoryChanges, MissionRewards, type, reward.itemCount, "MiscItems");
} else { } else {
logger.error(`rolled reward ${reward.itemCount}X ${reward.type} but unsure how to give it`); logger.error(`rolled reward ${reward.itemCount}X ${reward.type} but unsure how to give it`);