fix: propagate relic reward's itemCount (#1030)
Some checks failed
Build Docker image / docker (push) Waiting to run
Build / build (20) (push) Has been cancelled
Build / build (22) (push) Has been cancelled
Build / build (18) (push) Has been cancelled

Preemptive fix for a visual bug after completing a non-endless fissure.

Reviewed-on: #1030
This commit is contained in:
Sainan 2025-02-26 15:42:13 -08:00
parent 58ec63f7b9
commit 08f4137d71
2 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
import { IVoidTearParticipantInfo } from "@/src/types/requestTypes";
import { ExportRelics, ExportRewards, TRarity } from "warframe-public-export-plus";
import { getRandomWeightedReward2 } from "@/src/services/rngService";
import { getRandomWeightedReward2, IRngResult } from "@/src/services/rngService";
import { logger } from "@/src/utils/logger";
import { addMiscItems } from "@/src/services/inventoryService";
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
@ -9,7 +9,7 @@ import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
export const crackRelic = async (
inventory: TInventoryDatabaseDocument,
participant: IVoidTearParticipantInfo
): Promise<void> => {
): Promise<IRngResult> => {
const relic = ExportRelics[participant.VoidProjection];
const weights = refinementToWeights[relic.quality];
logger.debug(`opening a relic of quality ${relic.quality}; rarity weights are`, weights);
@ -30,6 +30,8 @@ export const crackRelic = async (
// Give reward
await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount);
return reward;
};
const refinementToWeights = {

View File

@ -320,8 +320,8 @@ export const addMissionRewards = async (
voidTearWave.Participants[0].QualifiesForReward &&
!voidTearWave.Participants[0].HaveRewardResponse
) {
await crackRelic(inventory, voidTearWave.Participants[0]);
MissionRewards.push({ StoreItem: voidTearWave.Participants[0].Reward, ItemCount: 1 });
const reward = await crackRelic(inventory, voidTearWave.Participants[0]);
MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount });
}
return { inventoryChanges, MissionRewards, credits };