Skip to content

Commit

Permalink
Fixed free not being free
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Sep 4, 2022
1 parent 315f64c commit 7b40cc1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/helpers/pile-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,10 @@ export function getItemPrices(item, {

itemFlagData = itemFlagData || getItemFlagData(item);

const overallCost = getProperty(item.toObject(), game.itempiles.ITEM_PRICE_ATTRIBUTE);
const overallCost = Number(getProperty(item.toObject(), game.itempiles.ITEM_PRICE_ATTRIBUTE));
const hasOtherPrices = itemFlagData.prices.filter(priceGroup => priceGroup.prices.length).length > 0;

if (itemFlagData?.free || (!itemFlagData.disableNormalCost && overallCost === 0 && itemFlagData.prices.length === 0)) {
if (itemFlagData?.free || (!itemFlagData.disableNormalCost && overallCost === 0 && !hasOtherPrices)) {
priceData.push({
free: true,
basePrices: [],
Expand Down

0 comments on commit 7b40cc1

Please sign in to comment.