From b4fedb7fff4ca80c43dee2842f694703450aa840 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 22 Jun 2024 23:19:42 +0200 Subject: [PATCH] fix: spy mission rewards (#370) --- src/services/missionInventoryUpdateService.ts | 12 ++++++++++-- src/types/requestTypes.ts | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index ba8ec93c2..b87b786ab 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -28,8 +28,16 @@ const getRewards = ({ return { InventoryChanges: {}, MissionRewards: [] }; } - const rotationCount = RewardInfo.rewardQualifications?.length || 0; - const rotations = getRotations(rotationCount); + let rotations: number[] = []; + if (RewardInfo.VaultsCracked) { + // For Spy missions, e.g. 3 vaults cracked = A, B, C + for (let i = 0; i != RewardInfo.VaultsCracked; ++i) { + rotations.push(i); + } + } else { + const rotationCount = RewardInfo.rewardQualifications?.length || 0; + rotations = getRotations(rotationCount); + } const drops: IReward[] = []; rewardManifests .map(name => ExportRewards[name]) diff --git a/src/types/requestTypes.ts b/src/types/requestTypes.ts index 3da747247..49917e9ae 100644 --- a/src/types/requestTypes.ts +++ b/src/types/requestTypes.ts @@ -63,6 +63,7 @@ export interface IMissionInventoryUpdateRequest { export interface IMissionInventoryUpdateRequestRewardInfo { node: string; + VaultsCracked?: number; // for Spy missions rewardTier?: number; nightmareMode?: boolean; useVaultManifest?: boolean;