From 83743831c9f18a18d88da0bf8c9ea3a1ee3bed14 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 3 May 2025 17:24:08 -0700 Subject: [PATCH] fix: don't divide by 0 (#1966) Closes #1964 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1966 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- 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) &&