Refactor removeResourceFromArea()
to use addItemToStash()
This commit is contained in:
parent
d112d0fa6e
commit
910b5e946c
@ -25,6 +25,7 @@ import { IHideoutToggleAreaRequestData } from "@spt-aki/models/eft/hideout/IHide
|
|||||||
import { IHideoutUpgradeRequestData } from "@spt-aki/models/eft/hideout/IHideoutUpgradeRequestData";
|
import { IHideoutUpgradeRequestData } from "@spt-aki/models/eft/hideout/IHideoutUpgradeRequestData";
|
||||||
import { IQteData } from "@spt-aki/models/eft/hideout/IQteData";
|
import { IQteData } from "@spt-aki/models/eft/hideout/IQteData";
|
||||||
import { IRecordShootingRangePoints } from "@spt-aki/models/eft/hideout/IRecordShootingRangePoints";
|
import { IRecordShootingRangePoints } from "@spt-aki/models/eft/hideout/IRecordShootingRangePoints";
|
||||||
|
import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest";
|
||||||
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
||||||
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
||||||
@ -491,26 +492,20 @@ export class HideoutController
|
|||||||
|
|
||||||
const itemToReturn = hideoutArea.slots.find((x) => x.locationIndex === slotIndexToRemove).item[0];
|
const itemToReturn = hideoutArea.slots.find((x) => x.locationIndex === slotIndexToRemove).item[0];
|
||||||
|
|
||||||
const newReq = {
|
const request: IAddItemDirectRequest = {
|
||||||
items: [{
|
itemWithModsToAdd: [
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
{
|
||||||
item_id: itemToReturn._tpl,
|
_id: this.hashUtil.generate(),
|
||||||
count: 1,
|
_tpl: itemToReturn._tpl
|
||||||
}],
|
}
|
||||||
tid: "ragfair",
|
],
|
||||||
};
|
foundInRaid: !!itemToReturn.upd.SpawnedInSession,
|
||||||
|
callback: null,
|
||||||
|
useSortingTable: false
|
||||||
|
}
|
||||||
|
|
||||||
output = this.inventoryHelper.addItem(
|
// If returned with errors, drop out
|
||||||
pmcData,
|
this.inventoryHelper.addItemToStash(sessionID, request, pmcData, output);
|
||||||
newReq,
|
|
||||||
output,
|
|
||||||
sessionID,
|
|
||||||
null,
|
|
||||||
!!itemToReturn.upd.SpawnedInSession,
|
|
||||||
itemToReturn.upd,
|
|
||||||
);
|
|
||||||
|
|
||||||
// If addItem returned with errors, drop out
|
|
||||||
if (output.warnings && output.warnings.length > 0)
|
if (output.warnings && output.warnings.length > 0)
|
||||||
{
|
{
|
||||||
return output;
|
return output;
|
||||||
|
Loading…
Reference in New Issue
Block a user