Added the ability to enable insurance behavior as in live eft (!408)

Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/408
Co-authored-by: DenisZhamkin <den.zhmakin.00@gmail.com>
Co-committed-by: DenisZhamkin <den.zhmakin.00@gmail.com>
This commit is contained in:
DenisZhamkin 2024-09-15 09:45:37 +00:00 committed by chomp
parent 50d8aa477e
commit 3bf00a6f27
3 changed files with 11 additions and 6 deletions

View File

@ -8,5 +8,6 @@
"returnTimeOverrideSeconds": 0,
"runIntervalSeconds": 600,
"minAttachmentRoublePriceToBeTaken": 2000,
"chanceNoAttachmentsTakenPercent": 10
"chanceNoAttachmentsTakenPercent": 10,
"isPveInsurance": false
}

View File

@ -128,11 +128,14 @@ 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 itemsToDelete = this.findItemsToDelete(rootItemParentID, insured);
// Actually remove them.
this.removeItemsFromInsurance(insured, itemsToDelete);
}
// Ensure that all items have a valid parent.
insured.items = this.itemHelper.adoptOrphanedItems(rootItemParentID, insured.items);

View File

@ -16,4 +16,5 @@ export interface IInsuranceConfig extends IBaseConfig {
minAttachmentRoublePriceToBeTaken: number;
// Chance out of 100% no attachments from a parent are taken
chanceNoAttachmentsTakenPercent: number;
isPveInsurance: boolean;
}