From c7f972942e7f8fad6ce89ca8d82de9cf88c279b2 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sun, 29 Jan 2017 17:35:30 +0100 Subject: [PATCH] auctionable check improvements --- core/post.lua | 2 +- core/stack.lua | 2 +- tabs/post/core.lua | 4 ++-- util/info.lua | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/post.lua b/core/post.lua index b674642..df634ab 100644 --- a/core/post.lua +++ b/core/post.lua @@ -31,7 +31,7 @@ end function post_auction(slot, k) local item_info = info.container_item(unpack(slot)) - if item_info.item_key == state.item_key and info.auctionable(item_info.tooltip) and item_info.aux_quantity == state.stack_size then + if item_info.item_key == state.item_key and info.auctionable(item_info.tooltip, nil, true) and item_info.aux_quantity == state.stack_size then ClearCursor() ClickAuctionSellItemButton() diff --git a/core/stack.lua b/core/stack.lua index 7a18a49..fc88b36 100644 --- a/core/stack.lua +++ b/core/stack.lua @@ -37,7 +37,7 @@ end function matching_item(slot, partial) local item_info = temp-info.container_item(unpack(slot)) - return item_info and item_info.item_key == state.item_key and info.auctionable(item_info.tooltip) and (not partial or item_info.count < item_info.max_stack) + return item_info and item_info.item_key == state.item_key and info.auctionable(item_info.tooltip, nil, true) and (not partial or item_info.count < item_info.max_stack) end function find_empty_slot() diff --git a/tabs/post/core.lua b/tabs/post/core.lua index 54cfb8e..2cea2da 100644 --- a/tabs/post/core.lua +++ b/tabs/post/core.lua @@ -344,7 +344,7 @@ function unit_vendor_price(item_key) temp(slot) local item_info = temp-info.container_item(unpack(slot)) if item_info and item_info.item_key == item_key then - if info.auctionable(item_info.tooltip, nil, item_info.lootable) then + if info.auctionable(item_info.tooltip, nil, true) and not item_info.lootable then ClearCursor() PickupContainerItem(unpack(slot)) ClickAuctionSellItemButton() @@ -402,7 +402,7 @@ function update_inventory_records() local item_info = temp-info.container_item(unpack(slot)) if item_info then local charge_class = item_info.charges or 0 - if info.auctionable(item_info.tooltip, nil, item_info.lootable) then + if info.auctionable(item_info.tooltip, nil, true) and not item_info.lootable then if not auctionable_map[item_info.item_key] then local availability = T for i = 0, 10 do diff --git a/util/info.lua b/util/info.lua index 62cd3f2..3bf2cab 100644 --- a/util/info.lua +++ b/util/info.lua @@ -262,11 +262,10 @@ function M.display_name(item_id, no_brackets, no_color) end end -function M.auctionable(tooltip, quality, lootable) +function M.auctionable(tooltip, quality, strict) local status = tooltip[2] and tooltip[2].left_text local durability, max_durability = durability(tooltip) - return not lootable - and (not quality or quality < 6) + return and (not quality or quality < 6) and status ~= ITEM_BIND_ON_PICKUP and status ~= ITEM_BIND_QUEST and status ~= ITEM_SOULBOUND