Skip to content

Commit

Permalink
Fixes to secondary prices
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Sep 2, 2024
1 parent 5fc6bab commit eaaadff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed adding container and non-stackable items into item piles from the same source would throw Foundry database errors
- Fixed merchant populate items tab not loading if a table had been added to the merchant and subsequently deleted
- Fixed issues with merchants and secondary prices

## Version 3.1.2

Expand Down
4 changes: 2 additions & 2 deletions src/helpers/pile-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,9 @@ function getItemFlagPriceData(priceData, quantity, modifier, defaultCurrencies,
price.data.item = CompendiumUtilities.getItemFromCache(price.data.uuid);
}

const isRegularCurrency = currencyList.find(currency => {
const isRegularCurrency = !price.secondary ? currencyList.find(currency => {
return currency.name === price.name && currency.img === price.img && (currency.data.uuid === price.data.uuid || currency.data.path === price.data.path)
});
}) : false;

const totalCost = isRegularCurrency ? price.quantity * isRegularCurrency.exchangeRate : 0;

Expand Down

0 comments on commit eaaadff

Please sign in to comment.