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:
parent
50d8aa477e
commit
3bf00a6f27
@ -8,5 +8,6 @@
|
||||
"returnTimeOverrideSeconds": 0,
|
||||
"runIntervalSeconds": 600,
|
||||
"minAttachmentRoublePriceToBeTaken": 2000,
|
||||
"chanceNoAttachmentsTakenPercent": 10
|
||||
"chanceNoAttachmentsTakenPercent": 10,
|
||||
"isPveInsurance": false
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user