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,6 +722,7 @@ export const addFixedLevelRewards = (
} }
} }
if (rewards.droptable) { if (rewards.droptable) {
if (rewards.droptable in ExportRewards) {
logger.debug(`rolling ${rewards.droptable} for level key rewards`); logger.debug(`rolling ${rewards.droptable} for level key rewards`);
const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]); const reward = getRandomRewardByChance(ExportRewards[rewards.droptable][0]);
if (reward) { if (reward) {
@ -730,6 +731,9 @@ export const addFixedLevelRewards = (
ItemCount: reward.itemCount ItemCount: reward.itemCount
}); });
} }
} else {
logger.error(`unknown droptable ${rewards.droptable}`);
}
} }
return missionBonusCredits; return missionBonusCredits;
}; };