From c0d3c5384f4002e4cae2679a6669125494f57d77 Mon Sep 17 00:00:00 2001 From: Kaeno Date: Wed, 22 May 2024 19:57:37 +0000 Subject: [PATCH] QuestitemInsurance (!350) Add ability to tell if we planted the item at a quest location (fishing gear, SV98) and dont return it with insurance Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/350 Co-authored-by: Kaeno Co-committed-by: Kaeno --- project/src/models/eft/inRaid/IInsuredItemsData.ts | 1 + project/src/services/InsuranceService.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/project/src/models/eft/inRaid/IInsuredItemsData.ts b/project/src/models/eft/inRaid/IInsuredItemsData.ts index 25702cdd..25ec7914 100644 --- a/project/src/models/eft/inRaid/IInsuredItemsData.ts +++ b/project/src/models/eft/inRaid/IInsuredItemsData.ts @@ -4,4 +4,5 @@ export interface IInsuredItemsData durability?: number maxDurability?: number hits?: number + usedInQuest: boolean } diff --git a/project/src/services/InsuranceService.ts b/project/src/services/InsuranceService.ts index 4bb8ee10..764d44f4 100644 --- a/project/src/services/InsuranceService.ts +++ b/project/src/services/InsuranceService.ts @@ -251,6 +251,14 @@ export class InsuranceService // equipment slot. const equipmentParentItem = this.itemHelper.getEquipmentParent(preRaidItem._id, preRaidGearMap); + const offraidDataitem = offraidData.insurance?.find( + (insuranceItem) => insuranceItem.id === insuredItem.itemId); + + if (offraidDataitem?.usedInQuest) + { + continue; + } + // Now that we have the equipment parent item, we can check to see if that item is located in an equipment // slot that is flagged as lost on death. If it is, then the itemShouldBeLostOnDeath. const itemShouldBeLostOnDeath = this.lostOnDeathConfig.equipment[equipmentParentItem?.slotId] ?? true;