From 2489b852490b2a2c5e58f7624b82fa707fb6322b Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 3 May 2025 00:13:06 +0200 Subject: [PATCH] fix: don't divide by 0 --- src/services/missionInventoryUpdateService.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 86c414f5..ce9920c8 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -1449,7 +1449,11 @@ function getRandomMissionDrops( } } rewardManifests = [job.rewards]; - rotations = [RewardInfo.JobStage! % (job.xpAmounts.length - 1)]; + if (job.xpAmounts.length > 1) { + rotations = [RewardInfo.JobStage! % (job.xpAmounts.length - 1)]; + } else { + rotations = [RewardInfo.JobStage!]; + } if ( RewardInfo.Q && (RewardInfo.JobStage === job.xpAmounts.length - 1 || job.isVault) &&