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 <tetrisggdev@gmail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/418
Co-authored-by: TetrisGG <tetrisgg@noreply.dev.sp-tarkov.com>
Co-committed-by: TetrisGG <tetrisgg@noreply.dev.sp-tarkov.com>
This commit is contained in:
TetrisGG 2024-10-31 10:31:45 +00:00 committed by chomp
parent 70ccacfee2
commit 2204181363

View File

@ -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 <IQuestReward[]>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(