Refactor inRaidHelper.removeSpawnedInSessionProeprtyFromitems()
This commit is contained in:
parent
fae6c57bfa
commit
c45c9185a6
@ -273,15 +273,17 @@ export class InRaidHelper
|
|||||||
*/
|
*/
|
||||||
public removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData
|
public removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData
|
||||||
{
|
{
|
||||||
const items = this.databaseServer.getTables().templates.items;
|
const dbItems = this.databaseServer.getTables().templates.items;
|
||||||
for (const offraidItem of postRaidProfile.Inventory.items)
|
const itemsToRemovePropertyFrom = postRaidProfile.Inventory.items.filter(x =>
|
||||||
{
|
{
|
||||||
// Remove the FIR status if the item marked FIR at raid start
|
// Has upd object + upd.SpawnedInSession property + not a quest item
|
||||||
if ("upd" in offraidItem && "SpawnedInSession" in offraidItem.upd && !items[offraidItem._tpl]._props.QuestItem)
|
return "upd" in x && "SpawnedInSession" in x.upd && !dbItems[x._tpl]._props.QuestItem;
|
||||||
{
|
});
|
||||||
delete offraidItem.upd.SpawnedInSession;
|
|
||||||
}
|
itemsToRemovePropertyFrom.forEach(item =>
|
||||||
}
|
{
|
||||||
|
delete item.upd.SpawnedInSession;
|
||||||
|
});
|
||||||
|
|
||||||
return postRaidProfile;
|
return postRaidProfile;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user