From 22041813638e5aadee1f24cbaf409f04455d7cae Mon Sep 17 00:00:00 2001 From: TetrisGG Date: Thu, 31 Oct 2024 10:31:45 +0000 Subject: [PATCH] Quest Rewards take GameEditions into account (!418) Fixes SPT/Issues#841 QuestReward with this property check the version of the PmcProfile, and skipped if it's not included / included depending on the property length > 0 check is workaround for Gunsmith Pt 25 Co-authored-by: TetrisGG Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/418 Co-authored-by: TetrisGG Co-committed-by: TetrisGG --- project/src/helpers/QuestHelper.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index fdac5ef6..1d8bdf06 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -929,7 +929,16 @@ export class QuestHelper { // e.g. 'Success' or 'AvailableForFinish' const questStateAsString = QuestStatus[state]; + const gameVersion = pmcProfile.Info.GameVersion; for (const reward of questDetails.rewards[questStateAsString]) { + // Handle quest reward availability for different game versions, notAvailableInGameEditions currently not used + if (reward.availableInGameEditions?.length > 0 && !reward.availableInGameEditions?.includes(gameVersion)){ + continue; + } + if (reward.notAvailableInGameEditions?.length > 0 && reward.notAvailableInGameEditions?.includes(gameVersion)){ + continue; + } + switch (reward.type) { case QuestRewardType.SKILL: this.profileHelper.addSkillPointsToPlayer(