syl3r86 / compendium-browser

A module to easily browse and filter spells as well as npcs loaded from compendie
0 stars 28 forks source link

Class filtering broken (with fix) #20

Open TehFisharmahn opened 1 year ago

TehFisharmahn commented 1 year ago

Hello!

I've found that in the latest version synced through Foundry's modules (0.8.1) the class filtering is broken.

I'm not JS savvy, but I debugged some via the console and found that the "passesFilter" method, when filtering with a class, uses the filter's path as "system.classes", while the property's name is just "classes".

I changed this at the beginning of the for:

let path = filter.path; if (path === 'system.classes') path = 'classes'; let prop = getProperty(subject, path);

This way filtering works, but it might break something else (I'm yet to find, hopefully not).

Hope this helps!