Fix: Improve orphaned item checking

This commit is contained in:
Dev 2023-04-12 15:41:48 +01:00
parent 34701d656f
commit 43d9f6490c

View File

@ -588,17 +588,18 @@ export class ProfileFixerService
// Get items placed in root of stash // Get items placed in root of stash
// TODO: extend to other areas / sub items // TODO: extend to other areas / sub items
const inventoryItems = pmcProfile.Inventory.items.filter(x => x.slotId === "main"); const inventoryItemsToCheck = pmcProfile.Inventory.items.filter(x => ["hideout", "main"].includes(x.slotId));
if (!inventoryItems) if (!inventoryItemsToCheck)
{ {
return; return;
} }
for (const item of inventoryItems) for (const item of inventoryItemsToCheck)
{ {
if (!itemsDb[item._tpl]) if (!itemsDb[item._tpl])
{ {
this.logger.error(this.localisationService.getText("fixer-mod_item_found", item._tpl)); this.logger.error(this.localisationService.getText("fixer-mod_item_found", item._tpl));
return; return;
} }
} }