View Single Post
04/19/18, 11:56 AM   #7
Phuein
 
Phuein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 132
Originally Posted by Baertram View Post
In order to find the error please post the whole code and not the snippet here only.
It seems that your index variable is NIL somehow.

Btw: Why do you copy the bag and slot to new vars?

local bag, index = bagId, slotId -- ZO_Inventory_GetBagAndIndex(inventorySlot)
Just use bagId and slotId if they are defined via ZO_Inventory_GetBagAndIndex(inventorySlot) before.
The values are checked and are fine. None of them are nil - the error has nothing to do with nil btw. The var copying is irrelevant here, just denotes my copying the values. This is all the relevant code needed to be reviewed.

Please note that I said above that Dolgubon's code (with fixes) works fine. My interest is in mimicking the game code, rather than overriding their way of locking items.

Last edited by Phuein : 04/19/18 at 11:59 AM.
  Reply With Quote