Removed redundant removeLostInsuranceFromProfile function

This commit is contained in:
Dev 2024-09-01 17:20:50 +01:00
parent ca23daa7b8
commit 3dc32f5b70
2 changed files with 0 additions and 12 deletions

View File

@ -324,14 +324,4 @@ export class InsuranceService {
// Try to use the equipment id from the profile. I'm not sure this is strictly required, but it feels neat.
return this.saveServer.getProfile(sessionID)?.characters?.pmc?.Inventory?.equipment ?? this.hashUtil.generate();
}
/**
* Remove lost insurance items from profiles insuredItems array
* @param profile Profile to remove from
* @param itemsToRemove Items to remove
*/
public removeLostInsuranceFromProfile(profile: IPmcData, itemsToRemove: Item[]) {
const itemIdsToRemove = new Set(itemsToRemove.map((item) => item._id));
profile.InsuredItems = profile.InsuredItems.filter((insuredItem) => !itemIdsToRemove.has(insuredItem.itemId));
}
}

View File

@ -590,8 +590,6 @@ export class LocationLifecycleService {
this.insuranceService.storeGearLostInRaidToSendLater(sessionId, mappedItems);
this.insuranceService.sendInsuredItems(preRaidPmcProfile, sessionId, locationName);
this.insuranceService.removeLostInsuranceFromProfile(preRaidPmcProfile, request.lostInsuredItems);
}
}