Originally Posted by ExoY
you dont use your table in that line anyway. You use the respective entry your loop is currently looking at.
So I dont know what you mean with that comment.
Also looks like you forgot to define the gemIndex locally. This can cause issues.
Also for troubleshooting, just use the function in quesiton (here: ChargeItemWithSoulGem) manually with script lines in chat.
That makes it easier to pin point the problem
|
Code:
function RidinDirty.GetGems()
for slotId = 0, GetBagSize(BAG_BACKPACK) do
if IsItemSoulGem(SOUL_GEM_TYPE_FILLED, BAG_BACKPACK, slotId) then
gemId = slotId
df("found gems %s", gemId) -- <<<<<< returning 0 to chat as well which makes no sense to me.. it should be the slot# i would think
return gemId
end
end
end