Skip to content

Commit

Permalink
Remove threshold for filtering users on dnd5e/pf2e
Browse files Browse the repository at this point in the history
Fix #339.
  • Loading branch information
mclemente committed Nov 20, 2023
1 parent fdb562b commit d26aed4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/module/providers/dnd5e.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default class dnd5eLanguageProvider extends LanguageProvider {
filterUsers(ownedActors) {
const filtered = super.filterUsers(ownedActors);
const party = game.actors.find((a) => a.id === game.settings.get("polyglot", "DND5E.TargetedParty"));
if (filtered.length > 10 && party?.system?.members.size) {
if (party?.system?.members.size) {
const members = Array.from(party.system.members.map((a) => a.id));
const users = filtered.filter((u) => ownedActors.some((actor) => members.includes(actor.id) && actor.testUserPermission(u, "OWNER"))
);
Expand Down
2 changes: 1 addition & 1 deletion src/module/providers/pf2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default class pf2eLanguageProvider extends LanguageProvider {
filterUsers(ownedActors) {
const filtered = super.filterUsers(ownedActors);
const party = game.actors.find((a) => a.id === game.settings.get("polyglot", "PF2E.TargetedParty"));
if (filtered.length > 10 && party?.members.length) {
if (party?.members.length) {
const members = party.members.map((a) => a.id);
const users = filtered.filter((u) => ownedActors.some((actor) => members.includes(actor.id) && actor.testUserPermission(u, "OWNER"))
);
Expand Down

0 comments on commit d26aed4

Please sign in to comment.