Remove duplicate method that does same as storeLostGear()
This commit is contained in:
parent
9f0e89611b
commit
1a3c107f0a
@ -180,11 +180,6 @@ export class InraidController
|
|||||||
this.updatePmcHealthPostRaid(postRaidSaveRequest, pmcData);
|
this.updatePmcHealthPostRaid(postRaidSaveRequest, pmcData);
|
||||||
this.inRaidHelper.deleteInventory(pmcData, sessionID);
|
this.inRaidHelper.deleteInventory(pmcData, sessionID);
|
||||||
|
|
||||||
if (insuranceEnabled)
|
|
||||||
{
|
|
||||||
this.insuranceService.storeInsuredItemsForReturn(pmcData, postRaidSaveRequest, preRaidGear, sessionID);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove quest items
|
// Remove quest items
|
||||||
if (this.inRaidHelper.removeQuestItemsOnDeath())
|
if (this.inRaidHelper.removeQuestItemsOnDeath())
|
||||||
{
|
{
|
||||||
|
@ -233,58 +233,6 @@ export class InsuranceService
|
|||||||
return hashTable;
|
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
|
* Add gear item to InsuredItems array in player profile
|
||||||
* @param pmcData profile to store item in
|
* @param pmcData profile to store item in
|
||||||
|
Loading…
Reference in New Issue
Block a user