fix: additional checks in bounty rewards (#1626)
All checks were successful
Build Docker image / docker (push) Successful in 58s
Build / build (push) Successful in 1m28s

Reviewed-on: #1626
Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
This commit is contained in:
AMelonInsideLemon 2025-04-15 06:10:25 -07:00 committed by Sainan
parent 8ebb749732
commit 43f3917b09

View File

@ -922,7 +922,7 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
if (syndicateEntry.Tag === "EntratiSyndicate") {
const vault = syndicateEntry.Jobs.find(j => j.locationTag === locationTag);
if (vault) job = vault;
if (vault && locationTag) job = vault;
// if (
// [
// "DeimosRuinsExterminateBounty",
@ -997,12 +997,14 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
(RewardInfo.JobStage === job.xpAmounts.length - 1 || job.isVault) &&
!isEndlessJob
) {
if (ExportRewards[job.rewards]) {
rewardManifests.push(job.rewards);
rotations.push(ExportRewards[job.rewards].length - 1);
}
}
}
}
}
} else if (RewardInfo.challengeMissionId) {
const rewardTables: Record<string, string[]> = {
EntratiLabSyndicate: [
@ -1053,9 +1055,12 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
if (rewardManifests.length != 0) {
logger.debug(`generating random mission rewards`, { rewardManifests, rotations });
}
rewardManifests
.map(name => ExportRewards[name])
.forEach(table => {
rewardManifests.forEach(name => {
const table = ExportRewards[name];
if (!table) {
logger.error(`unknown droptable: ${name}`);
return;
}
for (const rotation of rotations) {
const rotationRewards = table[rotation];
const drop = getRandomRewardByChance(rotationRewards);