View Single Post
11/09/14, 10:12 AM   #3
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Your function which scans backpack wont work correctly. There are two issues: slotIndex starts with 0, and you should be scanning all bag slots not just numUsedSlots. It is because not all slots are full.

Lua Code:
  1. local name
  2. local itemName
  3. local count
  4. local bagId = BAG_BACKPACK
  5. local numSlots = GetBagSize(bagId)
  6.  
  7. for slotId = 0, numSlots - 1 do
  8.     itemName = GetItemName(bagId, slotId)

As for the UI error - how is your addon manifest look like? It seems that you use LootManager in your XML for top level window. If xml file is listed after lua file in the addon manifest, your LootManager table defined in lua will be overwritten by the top level window defined in xml.
  Reply With Quote