Skip to content

Commit

Permalink
Fixed types accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
dmrickey committed Aug 1, 2023
1 parent e271871 commit 1014dfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bonuses/spells/helper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
2 changes: 1 addition & 1 deletion types/pf1/pf1.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ declare global {
domain: { [key: string]: number };
};
system: SystemItemSpellPF;
types: string;

/** @deprecated Spells don't have tags */
tag: string;
Expand Down Expand Up @@ -170,6 +169,7 @@ declare global {
}
interface SystemItemSpellPF extends SystemItem {
school: string;
types: string;
}
interface SystemWeaponPF extends SystemItem {
baseTypes: string[];
Expand Down

0 comments on commit 1014dfd

Please sign in to comment.