diff --git a/project/src/services/LocationLifecycleService.ts b/project/src/services/LocationLifecycleService.ts index f0b5914c..a4a34285 100644 --- a/project/src/services/LocationLifecycleService.ts +++ b/project/src/services/LocationLifecycleService.ts @@ -482,17 +482,7 @@ export class LocationLifecycleService { // Handle items transferred via BTR to player this.handleBTRItemTransferEvent(sessionId, request); - if (request.lostInsuredItems?.length > 0) { - const mappedItems = this.insuranceService.mapInsuredItemsToTrader( - sessionId, - request.lostInsuredItems, - request.results.profile, - ); - - this.insuranceService.storeGearLostInRaidToSendLater(sessionId, mappedItems); - - this.insuranceService.sendInsuredItems(pmcProfile, sessionId, locationName); - } + this.handleInsuredItemLostEvent(sessionId, pmcProfile, request, locationName); } /** @@ -565,6 +555,25 @@ export class LocationLifecycleService { ); } + protected handleInsuredItemLostEvent( + sessionId: string, + preRaidPmcProfile: IPmcData, + request: IEndLocalRaidRequestData, + locationName: string, + ) { + if (request.lostInsuredItems?.length > 0) { + const mappedItems = this.insuranceService.mapInsuredItemsToTrader( + sessionId, + request.lostInsuredItems, + request.results.profile, + ); + + this.insuranceService.storeGearLostInRaidToSendLater(sessionId, mappedItems); + + this.insuranceService.sendInsuredItems(preRaidPmcProfile, sessionId, locationName); + } + } + /** * Return the equipped items from a players inventory * @param items Players inventory to search through