Renamed hideout config property isPveInsurance
to simulateItemsBeingTaken
and updated code accordingly
This commit is contained in:
parent
3bf00a6f27
commit
ea0c37b179
@ -9,5 +9,5 @@
|
||||
"runIntervalSeconds": 600,
|
||||
"minAttachmentRoublePriceToBeTaken": 2000,
|
||||
"chanceNoAttachmentsTakenPercent": 10,
|
||||
"isPveInsurance": false
|
||||
"simulateItemsBeingTaken": true
|
||||
}
|
||||
|
@ -128,9 +128,9 @@ export class InsuranceController {
|
||||
|
||||
// Iterate over each of the insurance packages.
|
||||
for (const insured of insuranceDetails) {
|
||||
const isPveInsurance = this.insuranceConfig.isPveInsurance;
|
||||
if (!isPveInsurance) {
|
||||
// Find items that should be deleted from the insured items.
|
||||
const simulateItemsBeingTaken = this.insuranceConfig.simulateItemsBeingTaken;
|
||||
if (simulateItemsBeingTaken) {
|
||||
// Find items that could be taken by another player off the players body
|
||||
const itemsToDelete = this.findItemsToDelete(rootItemParentID, insured);
|
||||
|
||||
// Actually remove them.
|
||||
@ -659,13 +659,16 @@ export class InsuranceController {
|
||||
|
||||
/**
|
||||
* Insure softinserts of Armor that has softinsert slots
|
||||
* Allows armors to come back after being lost correctly
|
||||
* @param item Armor item to be insured
|
||||
* @param pmcData Player profile
|
||||
* @param body Insurance request data
|
||||
*/
|
||||
public insureSoftInserts(item: Item, pmcData: IPmcData, body: IInsureRequestData): void {
|
||||
const softInsertIds = this.itemHelper.getSoftInsertSlotIds();
|
||||
const softInsertSlots = pmcData.Inventory.items.filter((x) => x.parentId === item._id && softInsertIds.includes(x.slotId.toLowerCase()));
|
||||
const softInsertSlots = pmcData.Inventory.items.filter(
|
||||
(item) => item.parentId === item._id && softInsertIds.includes(item.slotId.toLowerCase()),
|
||||
);
|
||||
|
||||
for (const softInsertSlot of softInsertSlots) {
|
||||
this.logger.debug(`SoftInsertSlots: ${softInsertSlot.slotId}`);
|
||||
|
@ -16,5 +16,5 @@ export interface IInsuranceConfig extends IBaseConfig {
|
||||
minAttachmentRoublePriceToBeTaken: number;
|
||||
// Chance out of 100% no attachments from a parent are taken
|
||||
chanceNoAttachmentsTakenPercent: number;
|
||||
isPveInsurance: boolean;
|
||||
simulateItemsBeingTaken: boolean;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user