Skip to content

Commit

Permalink
Merge pull request #1045 from the-hideout/fix-cheapest-barter
Browse files Browse the repository at this point in the history
Fix display of cheapest barter
  • Loading branch information
Razzmatazzz authored Feb 7, 2025
2 parents 900d6ee + 717d1bd commit ddb266b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/components/barters-table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,7 @@ function BartersTable({ selectedTrader, nameFilter, itemFilter, showAll, useBart

return barters
.filter((barter) => {
if (!barter.rewardItems[0]) {
return false;
}

return true;
return !!barter.rewardItems[0];
})
.filter((barter) => {
if (!itemFilter) {
Expand Down Expand Up @@ -355,7 +351,7 @@ function BartersTable({ selectedTrader, nameFilter, itemFilter, showAll, useBart

tradeData.savingsParts = [];
const cheapestPrice = getCheapestCashPrice(barterRewardItem, settings, showAll);
const cheapestBarter = getCheapestBarter(barterRewardItem, {barters, crafts: useCraftIngredients ? crafts : false, settings, allowAllSources: showAll});
const cheapestBarter = getCheapestBarter(barterRewardItem, {barters, crafts: useCraftIngredients ? crafts : false, settings, useBarterIngredients, useCraftIngredients, allowAllSources: showAll});
if (cheapestPrice.type === 'cash-sell') {
//this item cannot be purchased for cash
if (cheapestBarter) {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/format-cost-items.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function getItemBarters(item, barters, settings, allowAllSources) {
continue;
}

if (!allowAllSources && barter.taskUnlock && settings.useTarkovTracker && !settings.completedQuests.includes[barter.taskUnlock?.id]) {
if (!allowAllSources && barter.taskUnlock && settings.useTarkovTracker && !settings.completedQuests.includes(barter.taskUnlock.id)) {
continue;
}

Expand Down Expand Up @@ -168,7 +168,7 @@ function getItemCrafts(item, crafts, settings, allowAllSources) {
return matchedCrafts;
}

if (!allowAllSources && craft.taskUnlock && settings.useTarkovTracker && !settings.completedQuests.includes[craft.taskUnlock.id]) {
if (!allowAllSources && craft.taskUnlock && settings.useTarkovTracker && !settings.completedQuests.includes(craft.taskUnlock.id)) {
return matchedCrafts;
}

Expand Down

0 comments on commit ddb266b

Please sign in to comment.