diff --git a/project/assets/configs/lostondeath.json b/project/assets/configs/lostondeath.json index 428b1b32..22196f90 100644 --- a/project/assets/configs/lostondeath.json +++ b/project/assets/configs/lostondeath.json @@ -8,6 +8,7 @@ "ArmorVest": true, "Eyewear": true, "TacticalVest": true, + "PocketItems": true, "Backpack": true, "Holster": true, "FirstPrimaryWeapon": true, diff --git a/project/src/helpers/InRaidHelper.ts b/project/src/helpers/InRaidHelper.ts index 2a1a44da..846359b4 100644 --- a/project/src/helpers/InRaidHelper.ts +++ b/project/src/helpers/InRaidHelper.ts @@ -707,6 +707,9 @@ export class InRaidHelper */ protected isItemKeptAfterDeath(pmcData: IPmcData, itemToCheck: Item): boolean { + // Use pocket slotId's otherwise it deletes the root pocket item. + const pocketSlots = ["pocket1", "pocket2", "pocket3", "pocket4"]; + // No parentId = base inventory item, always keep if (!itemToCheck.parentId) { @@ -727,6 +730,12 @@ export class InRaidHelper return true; } + // Should we keep items in pockets on death + if (!this.lostOnDeathConfig.equipment.PocketItems && pocketSlots.includes(itemToCheck.slotId)) + { + return true; + } + // Is quest item + quest item not lost on death if (itemToCheck.parentId === pmcData.Inventory.questRaidItems && !this.lostOnDeathConfig.questItems) { diff --git a/project/src/models/spt/config/ILostOnDeathConfig.ts b/project/src/models/spt/config/ILostOnDeathConfig.ts index db5eb4c3..6dc9a561 100644 --- a/project/src/models/spt/config/ILostOnDeathConfig.ts +++ b/project/src/models/spt/config/ILostOnDeathConfig.ts @@ -20,6 +20,7 @@ export interface Equipment ArmorVest: boolean; Eyewear: boolean; TacticalVest: boolean; + PocketItems: boolean; Backpack: boolean; Holster: boolean; FirstPrimaryWeapon: boolean;