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:
local lootCount = GetNumLootItems()
for i = 1, lootCount do
local lootId, name, _, _, _, _, _, _, lootItemType = GetLootItemInfo(i)
CHAT_SYSTEM:AddMessage("lootItemType = " .. lootItemType)
local link = GetLootItemLink(lootId)
local itemType = GetItemLinkItemType(link)
CHAT_SYSTEM:AddMessage("itemType = " .. itemType)
end