Originally Posted by Baertram
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.