Fixes Insured items on secured containers (!158)

This PR fixes both https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/174 and https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/175.

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/158
Co-authored-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-committed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
This commit is contained in:
TheSparta 2023-10-23 16:45:40 +00:00 committed by chomp
parent 69ee8983b2
commit 7aee78eb49
3 changed files with 6 additions and 12 deletions

View File

@ -1,4 +1,4 @@
import readline from "readline"; import readline from "node:readline";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { AsyncQueue } from "@spt-aki/utils/AsyncQueue"; import { AsyncQueue } from "@spt-aki/utils/AsyncQueue";

View File

@ -12,7 +12,6 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase"; import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { BodyPartHealth } from "@spt-aki/models/eft/common/tables/IBotBase"; import { BodyPartHealth } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { IRegisterPlayerRequestData } from "@spt-aki/models/eft/inRaid/IRegisterPlayerRequestData"; import { IRegisterPlayerRequestData } from "@spt-aki/models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
@ -159,7 +158,7 @@ export class InraidController
this.pmcChatResponseService.sendKillerResponse(sessionID, serverPmcData, postRaidRequest.profile.Stats.Eft.Aggressor); this.pmcChatResponseService.sendKillerResponse(sessionID, serverPmcData, postRaidRequest.profile.Stats.Eft.Aggressor);
this.matchBotDetailsCacheService.clearCache(); this.matchBotDetailsCacheService.clearCache();
serverPmcData = this.performPostRaidActionsWhenDead(postRaidRequest, serverPmcData, mapHasInsuranceEnabled, preRaidGear, sessionID); serverPmcData = this.performPostRaidActionsWhenDead(postRaidRequest, serverPmcData, sessionID);
} }
const victims = postRaidRequest.profile.Stats.Eft.Victims.filter(x => ["sptbear", "sptusec"].includes(x.Role.toLowerCase())); const victims = postRaidRequest.profile.Stats.Eft.Victims.filter(x => ["sptbear", "sptusec"].includes(x.Role.toLowerCase()));
@ -179,12 +178,10 @@ export class InraidController
* Alter bodypart hp, handle insurance, delete inventory items, remove carried quest items * Alter bodypart hp, handle insurance, delete inventory items, remove carried quest items
* @param postRaidSaveRequest Post-raid save request * @param postRaidSaveRequest Post-raid save request
* @param pmcData Pmc profile * @param pmcData Pmc profile
* @param insuranceEnabled Is insurance enabled
* @param preRaidGear Gear player had before raid
* @param sessionID Session id * @param sessionID Session id
* @returns Updated profile object * @returns Updated profile object
*/ */
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, insuranceEnabled: boolean, preRaidGear: Item[], sessionID: string): IPmcData protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, sessionID: string): IPmcData
{ {
this.updatePmcHealthPostRaid(postRaidSaveRequest, pmcData); this.updatePmcHealthPostRaid(postRaidSaveRequest, pmcData);
this.inRaidHelper.deleteInventory(pmcData, sessionID); this.inRaidHelper.deleteInventory(pmcData, sessionID);
@ -389,7 +386,7 @@ export class InraidController
this.saveServer.getProfile(sessionID).characters.scav = scavData; this.saveServer.getProfile(sessionID).characters.scav = scavData;
// Scav karma // Scav karma
this.handlePostRaidPlayerScavKarmaChanges(pmcData, offraidData, scavData, sessionID); this.handlePostRaidPlayerScavKarmaChanges(pmcData, offraidData);
// Scav died, regen scav loadout and set timer // Scav died, regen scav loadout and set timer
if (isDead) if (isDead)
@ -407,10 +404,8 @@ export class InraidController
* Update profile with scav karma values based on in-raid actions * Update profile with scav karma values based on in-raid actions
* @param pmcData Pmc profile * @param pmcData Pmc profile
* @param offraidData Post-raid save request * @param offraidData Post-raid save request
* @param scavData Scav profile
* @param sessionID Session id
*/ */
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData): void
{ {
const fenceId = Traders.FENCE; const fenceId = Traders.FENCE;

View File

@ -532,8 +532,7 @@ export class InRaidHelper
"pocket1", "pocket1",
"pocket2", "pocket2",
"pocket3", "pocket3",
"pocket4", "pocket4"
"SecuredContainer"
]; ];
let inventoryItems: Item[] = []; let inventoryItems: Item[] = [];