Skip to content

Commit

Permalink
closes #187
Browse files Browse the repository at this point in the history
  • Loading branch information
moody committed Dec 25, 2023
1 parent 505b9be commit 3b2d0c0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,25 @@ function Items:IsItemBound(item)
return false
end

function Items:IsItemJunkable(item)
return item.quality == Enum.ItemQuality.Poor or
item.quality == Enum.ItemQuality.Common or
item.quality == Enum.ItemQuality.Uncommon or
item.quality == Enum.ItemQuality.Rare or
item.quality == Enum.ItemQuality.Epic or
item.quality == Enum.ItemQuality.Heirloom
end

function Items:IsItemSellable(item)
return not item.noValue and
item.price > 0 and
item.quality >= Enum.ItemQuality.Poor and
item.quality <= Enum.ItemQuality.Epic
return not item.noValue and item.price > 0 and self:IsItemJunkable(item)
end

function Items:IsItemDestroyable(item)
if Addon.IS_RETAIL and item.classId == Enum.ItemClass.Battlepet then
return false
end

return item.quality >= Enum.ItemQuality.Poor and
item.quality <= Enum.ItemQuality.Epic
return self:IsItemJunkable(item)
end

function Items:IsItemRefundable(item)
Expand Down

0 comments on commit 3b2d0c0

Please sign in to comment.