Skip to content

Commit

Permalink
PF2e fix
Browse files Browse the repository at this point in the history
Fix #39
Latest PF2e version changed `quantity` to an Int instead an Object.
  • Loading branch information
mclemente committed Mar 26, 2022
1 parent 4cbee85 commit ccf2b69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/SystemProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ export class pf2eProvider extends SystemProvider {
const items = data.items.filter((a) => a.data.data.price);
for (const item of items) {
let [value, coin] = item.data.data.price.value.split(" ");
currency[coin] += Number(value) * item.data.data.quantity.value;
currency[coin] += Number(value) * (item.data.data.quantity?.value ?? item.data.data.quantity); //Fix for PF2e 3.7.2.10819 and later
}
return currency.cp / 100 + currency.sp / 10 + currency.gp + currency.pp * 10;
}
Expand Down

0 comments on commit ccf2b69

Please sign in to comment.