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