Skip to content

Commit

Permalink
another filter tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Dec 31, 2024
1 parent 594fff2 commit 53393af
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions ui/core/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1145,29 +1145,37 @@ export class Player<SpecType extends Spec> {
}

if (!filters.sources.includes(SourceFilterOption.SourceDungeon)) {
const zoneIds: Array<number> = [];

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<number> = [];

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) {
Expand Down

0 comments on commit 53393af

Please sign in to comment.