handle droptable possibly missing in ExportRewards
All checks were successful
Build / build (22) (push) Successful in 43s
Build / build (20) (push) Successful in 1m17s
Build / build (18) (push) Successful in 1m18s
Build / build (18) (pull_request) Successful in 47s
Build / build (20) (pull_request) Successful in 1m16s
Build / build (22) (pull_request) Successful in 1m16s

This commit is contained in:
Sainan 2025-04-06 16:27:22 +02:00
parent bd8c8513eb
commit 7ca8c9d857

View File

@ -722,13 +722,17 @@ export const addFixedLevelRewards = (
} }
} }
if (rewards.droptable) { if (rewards.droptable) {
logger.debug(`rolling ${rewards.droptable} for level key rewards`); if (rewards.droptable in ExportRewards) {
const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]); logger.debug(`rolling ${rewards.droptable} for level key rewards`);
if (reward) { const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]);
MissionRewards.push({ if (reward) {
StoreItem: reward.type, MissionRewards.push({
ItemCount: reward.itemCount StoreItem: reward.type,
}); ItemCount: reward.itemCount
});
}
} else {
logger.error(`unknown droptable ${rewards.droptable}`);
} }
} }
return missionBonusCredits; return missionBonusCredits;