From cdf3988d429e784a08ceecef086ecdab8f166d80 Mon Sep 17 00:00:00 2001 From: ckaotik Date: Thu, 17 Jun 2010 11:51:15 +0200 Subject: [PATCH] things. re-inserted combat-checkbox, eliminated some variables --- core.lua | 5 +++-- helper.lua | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core.lua b/core.lua index bee64ad..3aead83 100644 --- a/core.lua +++ b/core.lua @@ -382,9 +382,10 @@ function BrokerGarbage:GetItemValue(item, count) end if BrokerGarbage:GetCached(itemID) then - return BrokerGarbage:GetCached(itemID).value * count + return BrokerGarbage:GetCached(itemID).value * (count or 1) else - return nil + local value = BrokerGarbage:GetSingleItemValue(item) + return value and value * (count or 1) or nil end end diff --git a/helper.lua b/helper.lua index 53b5f39..8dea1d1 100644 --- a/helper.lua +++ b/helper.lua @@ -413,6 +413,7 @@ function BrokerGarbage:UpdateCache(itemID) return nil end + local value, _ = BrokerGarbage:GetSingleItemValue(itemID) -- check if item is excluded by itemID if BG_GlobalDB.exclude[itemID] or BG_LocalDB.exclude[itemID] then BrokerGarbage:Debug("Item "..itemID.." is excluded via its itemID.") @@ -420,7 +421,7 @@ function BrokerGarbage:UpdateCache(itemID) end -- check if the item is classified by its itemID - if not class then + if not class or class ~= BrokerGarbage.EXCLUDE then if BG_GlobalDB.include[itemID] or BG_LocalDB.include[itemID] then if BG_LocalDB.include[itemID] and type(BG_LocalDB.include[itemID]) ~= "boolean" then @@ -513,12 +514,12 @@ function BrokerGarbage:UpdateCache(itemID) end end - if not class then - value, class = BrokerGarbage:GetSingleItemValue(itemID) - end if not value then value = 0 end + if not class then + _, class = BrokerGarbage:GetSingleItemValue(itemID) + end -- save to items cache if not value or not class or not quality then -- 1.7.9.5