Implement keeping pocket items on death to LostOnDeath.json configuration (!246)
Addresses: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/443 Re-added the ability to keep pocket items on death. The reason for the naming is to not confuse the root `Pockets` item. Where as `PocketItems` is a better descriptive fit for the behaviour. New property in lostondeath.json -> `equipment.PocketItems` default `true` to discard items in pockets as normal on death. Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/246 Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com> Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
This commit is contained in:
parent
03ae37ec2f
commit
4da70b80d3
@ -8,6 +8,7 @@
|
||||
"ArmorVest": true,
|
||||
"Eyewear": true,
|
||||
"TacticalVest": true,
|
||||
"PocketItems": true,
|
||||
"Backpack": true,
|
||||
"Holster": true,
|
||||
"FirstPrimaryWeapon": true,
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -20,6 +20,7 @@ export interface Equipment
|
||||
ArmorVest: boolean;
|
||||
Eyewear: boolean;
|
||||
TacticalVest: boolean;
|
||||
PocketItems: boolean;
|
||||
Backpack: boolean;
|
||||
Holster: boolean;
|
||||
FirstPrimaryWeapon: boolean;
|
||||
|
Loading…
x
Reference in New Issue
Block a user