From 53393afdc559091a393849285d3d8c0e66ee3ab4 Mon Sep 17 00:00:00 2001 From: Kayla Glick Date: Tue, 31 Dec 2024 10:44:42 -0500 Subject: [PATCH] another filter tweak --- ui/core/player.ts | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/ui/core/player.ts b/ui/core/player.ts index e57e842d6..da304cee1 100644 --- a/ui/core/player.ts +++ b/ui/core/player.ts @@ -1145,29 +1145,37 @@ export class Player { } if (!filters.sources.includes(SourceFilterOption.SourceDungeon)) { + const zoneIds: Array = []; + for (const zoneName in DungeonFilterOption) { const zoneId = DungeonFilterOption[zoneName]; - if (typeof zoneId === 'number' && zoneId !== 0) { - itemData = filterItems( - itemData, - item => !item.sources.some(itemSrc => itemSrc.source.oneofKind === 'drop' && itemSrc.source.drop.zoneId === zoneId), - ); + if (typeof zoneId === 'number' && zoneId !== 0 && !filters.raids.includes(zoneId)) { + zoneIds.push(zoneId) } } + + itemData = filterItems( + itemData, + item => !item.sources.some(itemSrc => itemSrc.source.oneofKind === 'drop' && zoneIds.includes(itemSrc.source.drop.zoneId)), + ); } if (!filters.sources.includes(SourceFilterOption.SourceRaid)) { + const zoneIds: Array = []; + for (const zoneName in RaidFilterOption) { const zoneId = RaidFilterOption[zoneName]; if (typeof zoneId === 'number' && zoneId !== 0 && !filters.raids.includes(zoneId)) { - itemData = filterItems( - itemData, - item => !item.sources.some(itemSrc => itemSrc.source.oneofKind === 'drop' && itemSrc.source.drop.zoneId === zoneId), - ); + zoneIds.push(zoneId) } } + + itemData = filterItems( + itemData, + item => !item.sources.some(itemSrc => itemSrc.source.oneofKind === 'drop' && zoneIds.includes(itemSrc.source.drop.zoneId)), + ); } for (const zoneName in ExcludedZones) {