View Single Post
02/06/17, 11:21 PM   #3
Klingo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 16
Thumbs up

Oops :O

You're absolutely right. If I use the lootId and change the for-loop to start at 1, it is working exactly as expected.
Thanks a lot for pointing that out!

Lua Code:
  1. local lootCount =  GetNumLootItems()
  2. for i = 1, lootCount do
  3.     local lootId, name, _, _, _, _, _, _, lootItemType = GetLootItemInfo(i)
  4.  
  5.     CHAT_SYSTEM:AddMessage("lootItemType = " .. lootItemType)
  6.  
  7.     local link = GetLootItemLink(lootId)
  8.     local itemType = GetItemLinkItemType(link)
  9.  
  10.     CHAT_SYSTEM:AddMessage("itemType = " .. itemType)
  11. end
  Reply With Quote