fix: handle login reward not being able to give any recipe (#1479)
All checks were successful
Build / build (22) (push) Successful in 43s
Build / build (20) (push) Successful in 1m16s
Build / build (18) (push) Successful in 1m15s
Build Docker image / docker (push) Successful in 34s

Reviewed-on: #1479
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-04-06 06:04:55 -07:00 committed by Sainan
parent 64da8c2e50
commit b93a4a6dae

View File

@ -99,6 +99,10 @@ const getRandomLoginReward = (rng: CRng, day: number, inventory: TInventoryDatab
eligibleRecipes.push(uniqueName); eligibleRecipes.push(uniqueName);
} }
} }
if (eligibleRecipes.length == 0) {
// This account has all warframes and weapons already mastered (filthy cheater), need a different reward.
return getRandomLoginReward(rng, day, inventory);
}
reward.StoreItemType = toStoreItem(rng.randomElement(eligibleRecipes)); reward.StoreItemType = toStoreItem(rng.randomElement(eligibleRecipes));
} }
return { return {