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) {
logger.debug(`rolling ${rewards.droptable} for level key rewards`);
const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]);
if (reward) {
MissionRewards.push({
StoreItem: reward.type,
ItemCount: reward.itemCount
});
if (rewards.droptable in ExportRewards) {
logger.debug(`rolling ${rewards.droptable} for level key rewards`);
const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]);
if (reward) {
MissionRewards.push({
StoreItem: reward.type,
ItemCount: reward.itemCount
});
}
} else {
logger.error(`unknown droptable ${rewards.droptable}`);
}
}
return missionBonusCredits;