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,
|
"runIntervalSeconds": 600,
|
||||||
"minAttachmentRoublePriceToBeTaken": 2000,
|
"minAttachmentRoublePriceToBeTaken": 2000,
|
||||||
"chanceNoAttachmentsTakenPercent": 10,
|
"chanceNoAttachmentsTakenPercent": 10,
|
||||||
"isPveInsurance": false
|
"simulateItemsBeingTaken": true
|
||||||
}
|
}
|
||||||
|
@ -128,9 +128,9 @@ export class InsuranceController {
|
|||||||
|
|
||||||
// Iterate over each of the insurance packages.
|
// Iterate over each of the insurance packages.
|
||||||
for (const insured of insuranceDetails) {
|
for (const insured of insuranceDetails) {
|
||||||
const isPveInsurance = this.insuranceConfig.isPveInsurance;
|
const simulateItemsBeingTaken = this.insuranceConfig.simulateItemsBeingTaken;
|
||||||
if (!isPveInsurance) {
|
if (simulateItemsBeingTaken) {
|
||||||
// Find items that should be deleted from the insured items.
|
// Find items that could be taken by another player off the players body
|
||||||
const itemsToDelete = this.findItemsToDelete(rootItemParentID, insured);
|
const itemsToDelete = this.findItemsToDelete(rootItemParentID, insured);
|
||||||
|
|
||||||
// Actually remove them.
|
// Actually remove them.
|
||||||
@ -659,13 +659,16 @@ export class InsuranceController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Insure softinserts of Armor that has softinsert slots
|
* 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 item Armor item to be insured
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param body Insurance request data
|
* @param body Insurance request data
|
||||||
*/
|
*/
|
||||||
public insureSoftInserts(item: Item, pmcData: IPmcData, body: IInsureRequestData): void {
|
public insureSoftInserts(item: Item, pmcData: IPmcData, body: IInsureRequestData): void {
|
||||||
const softInsertIds = this.itemHelper.getSoftInsertSlotIds();
|
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) {
|
for (const softInsertSlot of softInsertSlots) {
|
||||||
this.logger.debug(`SoftInsertSlots: ${softInsertSlot.slotId}`);
|
this.logger.debug(`SoftInsertSlots: ${softInsertSlot.slotId}`);
|
||||||
|
@ -16,5 +16,5 @@ export interface IInsuranceConfig extends IBaseConfig {
|
|||||||
minAttachmentRoublePriceToBeTaken: number;
|
minAttachmentRoublePriceToBeTaken: number;
|
||||||
// Chance out of 100% no attachments from a parent are taken
|
// Chance out of 100% no attachments from a parent are taken
|
||||||
chanceNoAttachmentsTakenPercent: number;
|
chanceNoAttachmentsTakenPercent: number;
|
||||||
isPveInsurance: boolean;
|
simulateItemsBeingTaken: boolean;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user