返回提交历史
Modified
src/services/loginRewardService.ts
+2
-3
XFEstudio/XFESpaceNinjaServer
fix: only consider market-listed blueprints for login reward (#1900)
Closes #1882 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1900 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
9417aa3c
代码差异
1 个文件
+2
-3
@@ -77,7 +77,6 @@ const getRandomLoginReward = (rng: CRng, day: number, inventory: TInventoryDatab
77
77
const reward = rng.randomReward(randomRewards)!;
78
78
//const reward = randomRewards.find(x => x.RewardType == "RT_BOOSTER")!;
79
79
if (reward.RewardType == "RT_RANDOM_RECIPE") {
80
// Not very faithful implementation but roughly the same idea
81
80
const masteredItems = new Set();
82
81
for (const entry of inventory.XPInfo) {
83
82
masteredItems.add(entry.ItemType);
@@ -95,12 +94,12 @@ const getRandomLoginReward = (rng: CRng, day: number, inventory: TInventoryDatab
95
94
}
96
95
const eligibleRecipes: string[] = [];
97
96
for (const [uniqueName, recipe] of Object.entries(ExportRecipes)) {
98
if (unmasteredItems.has(recipe.resultType)) {
97
if (!recipe.excludeFromMarket && unmasteredItems.has(recipe.resultType)) {
99
98
eligibleRecipes.push(uniqueName);
100
99
}
101
100
}
102
101
if (eligibleRecipes.length == 0) {
103
// This account has all warframes and weapons already mastered (filthy cheater), need a different reward.
102
// This account has all applicable warframes and weapons already mastered (filthy cheater), need a different reward.
104
103
return getRandomLoginReward(rng, day, inventory);
105
104
}
106
105
reward.StoreItemType = toStoreItem(rng.randomElement(eligibleRecipes));