Update openRandomLootContainer()
to use addItemsToStash()
This commit is contained in:
parent
704b337a3c
commit
3587becf76
@ -12,6 +12,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
|||||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||||
import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest";
|
import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest";
|
||||||
import { IAddItemRequestData } from "@spt-aki/models/eft/inventory/IAddItemRequestData";
|
import { IAddItemRequestData } from "@spt-aki/models/eft/inventory/IAddItemRequestData";
|
||||||
|
import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest";
|
||||||
import { IInventoryBindRequestData } from "@spt-aki/models/eft/inventory/IInventoryBindRequestData";
|
import { IInventoryBindRequestData } from "@spt-aki/models/eft/inventory/IInventoryBindRequestData";
|
||||||
import { IInventoryCreateMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryCreateMarkerRequestData";
|
import { IInventoryCreateMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryCreateMarkerRequestData";
|
||||||
import { IInventoryDeleteMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
import { IInventoryDeleteMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
||||||
@ -948,17 +949,13 @@ export class InventoryController
|
|||||||
// Find and delete opened item from player inventory
|
// Find and delete opened item from player inventory
|
||||||
this.inventoryHelper.removeItem(pmcData, body.item, sessionID, output);
|
this.inventoryHelper.removeItem(pmcData, body.item, sessionID, output);
|
||||||
|
|
||||||
// Add reward items to player inventory
|
const addItemsRequest: IAddItemsDirectRequest = {
|
||||||
for (const itemWithChildrenToAdd of rewards)
|
itemsWithModsToAdd: rewards,
|
||||||
{
|
foundInRaid: foundInRaid,
|
||||||
const request: IAddItemDirectRequest = {
|
callback: null,
|
||||||
itemWithModsToAdd: itemWithChildrenToAdd,
|
useSortingTable: true
|
||||||
foundInRaid: foundInRaid,
|
|
||||||
callback: null,
|
|
||||||
useSortingTable: true
|
|
||||||
};
|
|
||||||
this.inventoryHelper.addItemToStash(sessionID, request, pmcData, output);
|
|
||||||
}
|
}
|
||||||
|
this.inventoryHelper.addItemsToStash(sessionID, addItemsRequest, pmcData, output);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user