diff --git a/project/src/controllers/InraidController.ts b/project/src/controllers/InraidController.ts index 585c9b9a..f34dae42 100644 --- a/project/src/controllers/InraidController.ts +++ b/project/src/controllers/InraidController.ts @@ -180,11 +180,6 @@ export class InraidController this.updatePmcHealthPostRaid(postRaidSaveRequest, pmcData); this.inRaidHelper.deleteInventory(pmcData, sessionID); - if (insuranceEnabled) - { - this.insuranceService.storeInsuredItemsForReturn(pmcData, postRaidSaveRequest, preRaidGear, sessionID); - } - // Remove quest items if (this.inRaidHelper.removeQuestItemsOnDeath()) { diff --git a/project/src/services/InsuranceService.ts b/project/src/services/InsuranceService.ts index f5e968d7..66cadd4b 100644 --- a/project/src/services/InsuranceService.ts +++ b/project/src/services/InsuranceService.ts @@ -233,58 +233,6 @@ export class InsuranceService return hashTable; } - /** - * Store insured items on pmc death inside insurance array in player profile - * @param pmcData Player profile - * @param offraidData Player gear post-raid - * @param preRaidGear Player gear before raid - * @param sessionID Session id - */ - public storeInsuredItemsForReturn(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string): void - { - const preRaidGearDictionary = {}; - const pmcItemsDictionary = {}; - const itemsToReturn = []; - - const itemsInSecureContainer = this.secureContainerHelper.getSecureContainerItems(offraidData.profile.Inventory.items); - - // Create dict of gear player had when entering raid - for (const item of preRaidGear) - { - preRaidGearDictionary[item._id] = item; - } - - // Create dict of gear player has post-raid - for (const item of pmcData.Inventory.items) - { - pmcItemsDictionary[item._id] = item; - } - - for (const insuredItem of pmcData.InsuredItems) - { - // Only return certain insured items: - // Existed before raid - // Not in secure container - // Not in PMC inventory post raid - if (preRaidGearDictionary[insuredItem.itemId] - && !(itemsInSecureContainer.includes(insuredItem.itemId)) - && !(typeof pmcItemsDictionary[insuredItem.itemId] === "undefined")) - { - itemsToReturn.push( - { "pmcData": pmcData, - "insuredItem": insuredItem, - "item": pmcItemsDictionary[insuredItem.itemId], - "sessionID": sessionID } - ); - } - } - - for (const item of itemsToReturn) - { - this.addGearToSend(item.pmcData, item.insuredItem, item.item, item.sessionID); - } - } - /** * Add gear item to InsuredItems array in player profile * @param pmcData profile to store item in