Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0
This commit is contained in:
commit
55eae60329
@ -523,12 +523,27 @@ export class InraidController
|
||||
/**
|
||||
* Handle singleplayer/traderServices/itemDelivery
|
||||
*/
|
||||
public itemDelivery(sessionId: string, traderId: string, items: Item[]): void
|
||||
public itemDelivery(sessionId: string, traderId: string, items: Item[]): void
|
||||
{
|
||||
const insuredItems: Item[] = items.filter(item =>
|
||||
this.insuranceService.getInsuranceItems(sessionId, Traders[traderId]).includes(item)
|
||||
);
|
||||
|
||||
// Remove insured items from the insurance list
|
||||
insuredItems.forEach(insuredItem =>
|
||||
{
|
||||
const insuranceList = this.insuranceService.getInsuranceItems(sessionId, Traders[traderId]);
|
||||
const index = insuranceList.indexOf(insuredItem);
|
||||
if (index !== -1)
|
||||
{
|
||||
insuranceList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
|
||||
const dialogueTemplates = this.databaseServer.getTables().traders[traderId].dialogue;
|
||||
const messageId = this.randomUtil.getArrayValue(dialogueTemplates.itemsDelivered);
|
||||
const messageStoreTime = this.timeUtil.getHoursAsSeconds(this.traderConfig.fence.btrDeliveryExpireHours);
|
||||
|
||||
|
||||
this.mailSendService.sendLocalisedNpcMessageToPlayer(
|
||||
sessionId,
|
||||
this.traderHelper.getTraderById(traderId),
|
||||
|
Loading…
Reference in New Issue
Block a user