diff --git a/src/bonuses/spells/helper.mjs b/src/bonuses/spells/helper.mjs index d9c963ea..62e52054 100644 --- a/src/bonuses/spells/helper.mjs +++ b/src/bonuses/spells/helper.mjs @@ -6,7 +6,7 @@ const regex = /([A-Za-z ])+/g; * @returns {string[]} */ export function getSpellTypes(item) { - return [...(item?.types || '').matchAll(regex)] + return [...(item?.system?.types || '').matchAll(regex)] .flatMap(([a]) => a.split('or')) .map((a) => a.trim().toLowerCase()); } diff --git a/types/pf1/pf1.d.ts b/types/pf1/pf1.d.ts index ab686099..df55f951 100644 --- a/types/pf1/pf1.d.ts +++ b/types/pf1/pf1.d.ts @@ -129,7 +129,6 @@ declare global { domain: { [key: string]: number }; }; system: SystemItemSpellPF; - types: string; /** @deprecated Spells don't have tags */ tag: string; @@ -170,6 +169,7 @@ declare global { } interface SystemItemSpellPF extends SystemItem { school: string; + types: string; } interface SystemWeaponPF extends SystemItem { baseTypes: string[];