diff --git a/Broker_Garbage.toc b/Broker_Garbage.toc
index 2b43a8e..ac9fc4c 100644
--- a/Broker_Garbage.toc
+++ b/Broker_Garbage.toc
@@ -11,7 +11,7 @@
## Notes-deDE: Endlich wieder Platz! Unterscheide Trödel von Schätzen und finde billigen Müll.
## LoadManagers: AddonLoader
-## X-LoadOn-Always: Delayed
+## X-LoadOn-Always: delayed
## X-Website: http://www.wowinterface.com/downloads/info15531-Broker_Garbage.html
## X-RelSite-WoWI: 15531
diff --git a/core.lua b/core.lua
index 6df141e..72900e9 100644
--- a/core.lua
+++ b/core.lua
@@ -40,6 +40,7 @@ BrokerGarbage.optionsModules = {} -- used for ordering/showing entries in the op
local locked = false -- set to true while selling stuff
local sellValue = 0 -- represents the actual value that we sold stuff for
local cost = 0 -- the amount of money that we repaired for
+local initialized = false
-- Event Handler
-- ---------------------------------------------------------
@@ -61,9 +62,10 @@ local function eventHandler(self, event, arg1, ...)
-- full inventory scan to start with
BrokerGarbage:ScanInventory()
+ initialized = true
frame:UnregisterEvent("ADDON_LOADED")
- elseif event == "BAG_UPDATE" then
+ elseif event == "BAG_UPDATE" and initialized then
if not arg1 or arg1 < 0 or arg1 > 4 then return end
BrokerGarbage:ScanInventoryContainer(arg1) -- partial inventory scan on the relevant container
@@ -385,10 +387,10 @@ function BrokerGarbage:GetSingleItemValue(item)
if not item then return nil end
local hasData, itemLink, itemQuality, itemLevel, _, _, _, _, itemType, _, vendorPrice = GetItemInfo(item)
- BrokerGarbage:Print("GetSingleItemValue("..(item or "?").."), "..(hasData or "no data"))
+ BrokerGarbage:Debug("GetSingleItemValue("..(item or "?").."), "..(hasData or "no data"))
hasData, itemLink, itemQuality, itemLevel, _, _, _, _, itemType, _, vendorPrice = GetItemInfo(item)
if not hasData then -- invalid argument
- BrokerGarbage:Print("Error! GetSingleItemValue: Failed on "..(itemLink or item or "<unknown>").."."..(hasData or "no data"))
+ BrokerGarbage:Debug("Error! GetSingleItemValue: Failed on "..(itemLink or item or "<unknown>").."."..(hasData or "no data"))
return nil
end
diff --git a/helper.lua b/helper.lua
index 1e68c5a..d6fc229 100644
--- a/helper.lua
+++ b/helper.lua
@@ -430,49 +430,45 @@ function BrokerGarbage:CanDisenchant(itemLink, location)
required = Enchantrix.Util.DisenchantSkillRequiredForItem(itemLink) -- might be more accurate/up to date in case I miss something
skillRank = Enchantrix.Util.GetUserEnchantingSkill() -- Enchantrix caches this. So let's use it!
else
- local item = BrokerGarbage:GetCached(BrokerGarbage:GetItemID(itemLink))
- if not item then return end
-
- quality, level, stackSize = item.quality, item.level, item.stackSize
- local _, _, quality, level, _, _, _, count, bagSlot = GetItemInfo(itemLink)
+ local _, _, quality, level, _, _, _, stackSize, invType = GetItemInfo(itemLink)
-- stackables are not DE-able, legendary/heirlooms are not DE-able
- if item.quality >= 2 and item.quality < 5 and item.stackSize == 1
- and string.find(item.itemType, "INVTYPE") and not string.find(item.itemType, "BAG") then
+ if quality >= 2 and quality < 5 and stackSize == 1
+ and string.find(invType, "INVTYPE") and not string.find(invType, "BAG") then
skillRank = BrokerGarbage:GetProfessionSkill(BrokerGarbage.enchanting) or 0
if skillRank > 0 then
- if item.level <= 20 then
+ if level <= 20 then
required = 1
- elseif item.level <= 60 then
+ elseif level <= 60 then
required = 5*5*math.ceil(level/5)-100
- elseif item.level <= 99 then
+ elseif level <= 99 then
required = 225
- elseif item.level <= 120 then
+ elseif level <= 120 then
required = 275
else
- if item.quality == 2 then -- green
- if item.level <= 150 then
+ if quality == 2 then -- green
+ if level <= 150 then
required = 325
- elseif item.level <= 200 then
+ elseif level <= 200 then
required = 350
- elseif item.level <= 305 then
+ elseif level <= 305 then
required = 425
else
required = 475
end
- elseif item.quality == 3 then -- blue
- if item.level <= 200 then
+ elseif quality == 3 then -- blue
+ if level <= 200 then
required = 325
- elseif item.level <= 325 then
+ elseif level <= 325 then
required = 450
else
required = 500
end
- elseif item.quality == 4 then -- purple
- if item.level <= 199 then
+ elseif quality == 4 then -- purple
+ if level <= 199 then
required = 300
- elseif item.level <= 277 then
+ elseif level <= 277 then
required = 375
else
required = 500