Added helper function handleInsuredItemLostEvent()
This commit is contained in:
parent
3d1aa5e4fc
commit
8fc2428239
@ -482,17 +482,7 @@ export class LocationLifecycleService {
|
|||||||
// Handle items transferred via BTR to player
|
// Handle items transferred via BTR to player
|
||||||
this.handleBTRItemTransferEvent(sessionId, request);
|
this.handleBTRItemTransferEvent(sessionId, request);
|
||||||
|
|
||||||
if (request.lostInsuredItems?.length > 0) {
|
this.handleInsuredItemLostEvent(sessionId, pmcProfile, request, locationName);
|
||||||
const mappedItems = this.insuranceService.mapInsuredItemsToTrader(
|
|
||||||
sessionId,
|
|
||||||
request.lostInsuredItems,
|
|
||||||
request.results.profile,
|
|
||||||
);
|
|
||||||
|
|
||||||
this.insuranceService.storeGearLostInRaidToSendLater(sessionId, mappedItems);
|
|
||||||
|
|
||||||
this.insuranceService.sendInsuredItems(pmcProfile, sessionId, 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
|
* Return the equipped items from a players inventory
|
||||||
* @param items Players inventory to search through
|
* @param items Players inventory to search through
|
||||||
|
Loading…
x
Reference in New Issue
Block a user